• 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

referencing a value in a textfield without using request.getParameter

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ...
need some help in figuring out this...

how do u reference a value from a text field without using request.getPArameter in jsp.I need to parse this value to a bean file tht calls the database.

PPLLLLLLZZZ help!!
ciao
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's wrong with request.getParameter()?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And...

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

thanks,
bear
JSP Forum Bartender
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think you need to parse the string into integer (or) parsing of the string also . Get the value into the string "beforeParse" and write one java program to parse the string to your desired type and return the value into the data type you required.

example.
1.jsp
< jsp:useBean id="parse" class="parse" >
.....
String beforeParse = request.getParameter("myvalue");
int i = parse(beforeParse);

parse.java

public int parse(String s)
{
// write the neccessary code here

}

I think this will be help full to you.
 
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
As an academic excercise, this could be pretty interesting -- sort of like Perl before mod_cgi. Otherwise, I can't see any good reason not to use getParameter.

Look at the HttpServletRequest API:
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html

Specifically, look at getQueryString and getInputStream (which is in the superclass, ServletRequest).

You'll have some string parsing to do. If this is for a class assignment, remember, there can be more than one HTTP form field with the same name.

Be sure to post back and let us know why you're doing this.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey what is the Problem with getParameter method,Whatever u want to do,Simply call this method,It will return u some String.Then Parse that String And Use that variable in whatever way u do like.Or is it necessary that u don't want to use getParameter then the case may be different.
 
Ben Souther
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 John Dhoom:
Hey what is the Problem with getParameter method,Whatever u want to do,Simply call this method,It will return u some String.Then Parse that String And Use that variable in whatever way u do like.Or is it necessary that u don't want to use getParameter then the case may be different.



John,
Did you read the third post in this thread?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic