welly

how to get remote IP address or remote host? sorry for silly question

Discussion created by welly on Oct 12, 2006

Hi Guys,

 

sorry for silly question

 

I am trying to get remote IP address or remote host in spark of webchat user.

there are two ways i think

1.get IP from spark -> is there any way to get remote ip from spark?

2.edit the parameter from webchat (queue.jsp)

 

this is the code form queue.jsp (webchat of faspath)

 

<%@ page import="com.jivesoftware.webchat.actions.ChatStarter,

com.jivesoftware.webchat.actions.WorkgroupStatus,

com.jivesoftware.webchat.util.ModelUtil,

com.jivesoftware.webchat.util.ParamUtils" %>

<%@ page import="com.jivesoftware.webchat.ChatSession"%><%@ page import="com.jivesoftware.webchat.ChatManager"%>

<%@ page errorPage="fatal.jsp" %>

<script type=''text/javascript'' src=''<%= request.getContextPath()%>/dwr/interface/room.js''></script>

<script type=''text/javascript'' src=''<%= request.getContextPath()%>/dwr/engine.js''></script>

<%

ChatStarter chatStarter = new ChatStarter();

%>

<%

final String workgroup = ParamUtils.getParameter(request, "workgroup");

// Add workgroup to session

session.setAttribute("workgroup", workgroup);

final String chatID = ParamUtils.getParameter(request, "chatID");

final String question = ParamUtils.getParameter(request, "question"); --> basicaly i just want to append remoteip or remote host to the question (any idea how to do setparameter?) .

session.setAttribute("chatID", chatID);

if (ModelUtil.hasLength(question)) {

session.setAttribute("Question", question);

}

if (!WorkgroupStatus.isOnline(workgroup)) {

response.sendRedirect("email/leave-a-message.jsp?workgroup=" + workgroup);

return;

}

chatStarter.init(pageContext);

// Define the starting paramters for this chat session

 

/**

  • @param workgroup the name of the workgroup to join.

  • @param chatID the unique id for this session.

*/

chatStarter.startSession(workgroup, chatID);

%>

Thanks

 

Welly

 

Anybody can help me?

 

thanks in advance

Outcomes