Link to home
Start Free TrialLog in
Avatar of sdesar
sdesar

asked on

How to pass parameters to a JSP?

I have this tree.jsp that accespts 3 parameters when its run ie - jsessionId, projectName, serverName that get passed from another jsp.

How can I modify the following code so that these parameters are always there when the code is run as a standalone jsp with its own
3 parameters -

jessionid = request.getID() ..?
projectName = "test_project";
serverName = "alien00";

So the url when the jsp is run will always have this as its URL -

http://www.test.com/tree.jsp?jsessionid=12324&projectName=test_project&serverName=alien00

the jsesssionid should always be the same with in the same browser and if the user opens a new browser then the jessionid would change.

Eagerly awaiting a response
Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sdesar
sdesar

ASKER

I need your help with the exact syntax on how to pass the above parameters

awaiting a response
Thanks
How to pass where??
if you are passing them to a URL then you will have to built the url like...
jessionid = request.getID() ..?
projectName = "test_project";
serverName = "alien00";

http://www.test.com/tree.jsp?jsessionid=<%=jsessionid%>&projectName=<%=projectName%>&serverName=<%=serverName%>

if they are the form element, they will get passed automatically....
Avatar of sdesar

ASKER

Thanks Kuldeepchaturvedi!
here are you excellent points.
Glad to be of help...:-)