Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the client IP Address in SilverStream 2

Status
Not open for further replies.

KirkKelly

Programmer
Jan 5, 2001
15
US
Can anybody tell me how to get the IP address in a silverstream page?

Thanks
Kirk
 
You can use getCurrentRequest().getRemoteAddr() in a page.

FYI, the request event object that is passed to a SilverStream servlet is an
com.sssw.srv.busobj.AgoHttpRequestEvent

The implementation/inheritance tree looks like this:

javax.servlet.ServletRequest
is extended by
javax.servlet.http.HttpServletRequest
is extended by
com.sssw.shr.http.AgiHttpServletRequest
is implemented by
com.sssw.srv.busobj.AgoHttpRequestEvent

So, you can use methods in any/all of these objects.
Some methods are getParameter(String), getParameterNames(),
getRemoteAddr(), getRemoteHost(), getServerName(), getServerPort(),
getCookies(), getHeader(String), getRemoteUser()

To get a reference to this object, use getCurrentRequest() in your page.
This returns an AgiHttpServletRequest reference, so to use any methods in
AgoHttpRequestEvent (see
D:\SilverStream25\docs\help\reference\AgoHttpRequestEvent.main.html in the
docs) you must cast.
 
Hi friend

you know how to deploy the JSP in SilverStream appllication server3.7.

I installed the SilverStream 3.7 in the C directory of my machine.

Is it necessary to set the classpath to the WAR directory?

I created the war file as test.war containing test.jsp, i put the test.war file in c:\silverstream37\WAR directory.

test.jsp is the jsp file.i put it in c:\silverstream37\war\root directory.

I am using SilverCMD tool to build the war file and also to deploy the war file to SilverStream application server.

c:\silverstream37\war>SilverCMD BuildWAR localhost mydatabase root\test.jsp -n test.war

localhost - server machine
mydatabase - silvermaster database name.

test.war file is created with this contents....

added manifest
adding: root/test.jsp(in = 298) (out = 200)(deflated 32%)

While i deploying the war file from the command line tool i am getting this error.

c:\silverstream37\war>SilverCMD DeployWAR localhost mydatabase test.war -f deplplan.xml -o

where deplplan.xml is the deployment descriptor for the war file.

Error:

Database 'mydatabase' not found on the server
anybody knows the solution for this problem.....

i need ur help friends

Regards
Kumaran.S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top