This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Servlets and the fly likes Form Variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Form Variables" Watch "Form Variables" New topic

Form Variables

Subbu Viswanathan

Joined: May 15, 2001
Posts: 8
Can someone help with my previous post, PLEASE
Zoe Peng
Ranch Hand

Joined: Nov 27, 2000
Posts: 112
It's hard to find ur previous post.
why don't u post the url for us??
helpful a lot. I think so.
Subbu Viswanathan

Joined: May 15, 2001
Posts: 8
Still I am not sure what to do with this issue. I have the option of using Client Side JavaScript, but how can I load the 3rd party servlet (which I don't have control of) and upon hitting back on the browser come back to my starting JSP page, thereby ignoring the intermediate servlet.
Please help me out anybody??Thanks much
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
I went through your discussion with Mike and this is what understood as your need.
1. There is a first.jsp
( FirstName , LastName - form vars)
2. Need to add more param along with first.jsp's form params (Nationality, Interest,member)
3. Should be able to call Third Party Servlet which will get off all TOTAL 5 form params (firstName,LastName,Nationality, Interest,member)in this manner:
If this is right, I just tested with the following code and able to get all TOTAL params in third party servlet named as BlackBoxServlet.
Save the code as

I checked on the BackButton. No problem in going back straight to first.jsp. Also no JavaScript!
PLease tell us if this is what you wanted. Ignore those extra (not needed) import statements in code. I am tooooooo lazy to edit them
maha anna

[This message has been edited by maha anna (edited May 16, 2001).]
Subbu Viswanathan

Joined: May 15, 2001
Posts: 8
Thanks Maha for your post...
This section of the code errors out.
<jsp:forward page="/servlet/BlackBoxServlet" >
<jsp aram name="Nationality" value="Indian" />
<jsp aram name="Interest" value="Java" />
<jsp aram name="member" value="" />
The error message that I receive is
500 Internal Server Error
Java Server Page Translation Error
Error during page parsing:
com.sun.server.http.pagecompile.jsp.compiler.ParseException: C:\Inprise\AppServer\html\public_html\bbb.jsp(2,28) Unterminated.
I tried replacing the 2nd line with
<jsp:forward page="/servlet/BlackBoxServlet" /> and there are no errors. However this defeats the purpose of passing parameters from this page to the next page.
We're using Borland Inprise Application Server 4.1.1 and I checked their documentation and it states that, the web-container supports JSP 1.0
In JSP 1.0, I guess that the <jsp:forward> tag is valid when the tag is coded something like
<jsp:forward page="/servlet/BlackBoxServlet" />
<jsp:forward page="/servlet/BlackBoxServlet">
I think, we have to upgrade our AppServer to achieve the functionality that is required.
Thanks Maha and Mike for your responses..
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Yes. It's better to upgrade to jsp1.1.
If appending to URL is not a problem for you, Then do this trick.
I know how desperate sometimes we become to see the results. Atleast I become very desperate in these kind of situations like reaching 75% solution but not able to implement the rest 25%.
Atleast to see the results once (with dirty trick ) code this line and invoke your first.jsp and see all 5 params passed to BlackBoxServlet. Latter upgrade to 1.1 version.
//addMore.jsp (will have only this line!) (for jsp 1.o version)
<jsp:forward page="/servlet/BlackBoxServlet?Nationality=Indian&Interest=Java&"/>
maha anna
Subbu Viswanathan

Joined: May 15, 2001
Posts: 8
Hi Maha,
I even tried exactly the same code as u have suggested in AddMore.jsp
<jsp:forward page="/servlet/BlackBoxServlet?Nationality=Indian&Interest=Java&"/>
Also there are no <jsp aram> directives in this page.
The error message that I get now is----
Forbidden (403)
You have requested data that the server has decided not to provide to you.Your request was understood and denied.
JSP 1.0 doesn't even allow querystring params to be passed. It can just do a forward to a page without.
Anyway, thanks much for your follow-up on this post.
I agree. Here's the link:
subject: Form Variables
It's not a secret anymore!