File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes referencing a value in a textfield without using request.getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "referencing a value in a textfield without using request.getParameter" Watch "referencing a value in a textfield without using request.getParameter" New topic
Author

referencing a value in a textfield without using request.getParameter

payal kapadia
Greenhorn

Joined: Feb 08, 2005
Posts: 10
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

What's wrong with request.getParameter()?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

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
pradeep jaladi
Ranch Hand

Joined: Nov 21, 2004
Posts: 65
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.


Pradeep.Jaladi
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Vijay Sharma
Ranch Hand

Joined: Feb 02, 2005
Posts: 32
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.


Vijay Sharma
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: referencing a value in a textfield without using request.getParameter