Solved

How to pass parameters to a JSP?

Posted on 2004-04-15
5
242 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
  • 3
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 100 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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