• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

values from jsp to servlet

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a variable on my jsp which I want to use on my servlet. The param option I would like to use but I keep getting an error saying it needs to be enclosed in another call. I don't know which jsp method to use. help!
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please show how you're trying to use it, and what the exact error is.
 
Donna Bachner
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is what I have:
<jsp:useBean id="buyBean" class="buyer.buyBean" scope="session"/>

<jsp :param name="ISBN" value="ISBN>value"/>
and it tells me it can not be used outside a jsp :params, a jsp:include or a jsp:forward.

How do I do that?
I tried to put the param inside these statements and it says for the jsp:include jsp:forward that they need terminated. The jsp :p arams says it must be a child?

[BPSouther: Disabled graemlins for this post to stop JSP tags from grinning at us]
[ December 01, 2006: Message edited by: Ben Souther ]
 
Donna Bachner
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it to work sort of. It is noe asking for the standard name and value. apparently it does not like ISBN and ISBN.value.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Donna Bachner:
I got it to work sort of. It is noe asking for the standard name and value. apparently it does not like ISBN and ISBN.value.



No, your naming should follow the standard javabean convention.
Example: a property with getFirstName and setFirsName accessors and mutators would have the following name value in your JSP tags fistName.
Using all capital letters will throw the JSP compiler off.
 
Donna Bachner
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The value I am trying to get is in a text box in the jsp. How do I get the value from the GUI? I changed the name to isbn the value would be isbn.value.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to read up on servlets/jsp. There are several free books out there. I would recommend "core servlet and JSP by Marty Hall"

In your jsp you have a textbox called ISBN. To read the value associated with that textbox in your servlet use getParameter("ISBN")on the request object.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic