?
Solved

How to pass parameters to a JSP?

Posted on 2004-04-15
5
Medium Priority
?
248 Views
Last Modified: 2010-04-01
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!
0
Comment
Question by:sdesar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 400 total points
ID: 10835597
I am sorry I can't understand the question here...
jessionid = request.getID() ..?
the correct way is
jessionid = session.getID();
0
 

Author Comment

by:sdesar
ID: 10836081
I need your help with the exact syntax on how to pass the above parameters

awaiting a response
Thanks
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10836125
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....
0
 

Author Comment

by:sdesar
ID: 10933360
Thanks Kuldeepchaturvedi!
here are you excellent points.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10933391
Glad to be of help...:-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll show how research, determination, and use of modern technology helped me solve a DNA mystery.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question