Solved

How to pass parameters to a JSP?

Posted on 2004-04-15
5
239 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now