• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp problem

 
Rajiv Chelsea
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying a jsp demo to learn exception handling
Here are my source files
one html and one jsp






When I enter an age in the form, the age is not displayed

The output comes like following:

Your age is : years.

Back.


Please tell me if there is any error?

 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For learming purposes scriptlets are ok...
but if you want to follow new new standards in jsp try JSTL and EL ...
you can go through JSTL BASICS in this linkJSTL BASICS
....

for your solution try this

p>Your age is : <%= Integer.parseInt(request.getParameter("age")) %> years.</p>

i did n't tested its just a suggestion ....

once more please avoid scriptlets ...
 
Rajiv Chelsea
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its still not working...
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajiv Chelsea wrote:Its still not working...

Are you entering the value in the text box in the html file ??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to take the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptove subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine.

Using a title of "jsp problem" in a forum completely dedicated to questions on JSP isn't going to attract the attention of those who can best help you.You can change your subject line by clicking the button on your post.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's 2010. The time to be putting scriptlets and Java code in JSP is long long passed. Devote your learning time to something useful -- how to write modern JSPs. Not JSP as it was written in 2001.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!