This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error in Textbox  RSS feed

 
Jithesh Kozhipurath
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I am new to JSP. I tried with a small program
<HTML>
<HEAD>
<TITLE>Form Content</TITLE>
</HEAD>
<BODY>
<H3>Fill-out-form</H3>
<P>
<FORM action="Form.jsp" method="GET">
Name = <input type="text" name="name" value="${param['name']}">
<input type="submit" value="Submit Name">
</FORM>
<P>
The Name is: ${param.name}
</BODY>
</HTML>
Its not getting submitted to the page. First time it displays ${param['name']}"> in the text box as well as in "The Name is ".
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jithesh Kozhipurath:

Name = <input type="text" name="name" value="${param['name']}">
<input type="submit" value="Submit Name">
</FORM>
<P>
The Name is: ${param.name}


The problem with the above code is you are using JSTL syntax in an incorrect manner. If you wanted to used JSTL, you will need to first declare the taglib, have the appropriate JSTL jar (from Jakarta) and the tlds in your web application (for details of all these things, do a search on JSTL in this forum)
The syntax to use for the above will be <cut value="$param.name" />
hth
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jithesh, what JSP engine are you using and what level of JSP?
My guess is Tomcat5 and JSP2 (which allows the JSTL expression language in lieue of traditional JSP notation).
If not, then Faisal is right and you cannot use the EL outside of JSTL tag attributes.
If you are using JSP 2 and are new to JSP, you might be better served to use a JSP 1.2 engine (such as Tomcat4) until you get on your feet. There are a lot more people familair with JSP 1.2 than JSP 2 (so you'll get more help) and the JSP 2 engines (Tomcat5 being the only one I know of) are of beta quality and you'll have a hard time distinguishing engine bugs from mistakes that you are making.
hth,
bear
 
Jithesh Kozhipurath
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I am using tomacat 4.1.27 and jdk 1.2 Is there any problem for the code to run in this configuration .
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomacat 4.1.27

Then re-read Faisal's response. You cannot use the ${} notation in JSP 1.2 except as part of the JSTL tags (which you must add to Tomcat... they're not part of the standard distribution).
hth,
bear
 
Jithesh Kozhipurath
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you friends,
What should i install if a want to use those methods
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Jakarta implementation of the JSTL can be found here.
hth,
bear
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!