You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ralph Merrick <ja...@yahoo.com> on 2002/09/26 00:22:01 UTC

Need quick help please

Does any know out there how to send the value of hidden or non hidden input fields through the action of a form, You know that usually a form has the following signature: 

<FORM NAME="add" ACTION="save.jsp" METHOD="POST">

SO lets say you have an hidden input number:

<INPUT TYPE="hidden" NAME="number" VALUE="6">

in a page called add.jsp and its signature in the form is <FORM NAME="add" ACTION="save.jsp" METHOD="POST">

so, can you do <FORM NAME="add" ACTION="save.jsp?number="number METHOD="POST">

or something like that , because with JSP for ex. I know you can use 1 of two ways,

Either request.getParameter("field name") in the page like save.jsp which will read inputs from the add.jsp page  or you can use JSP forward as parameters

Does any also know why the request.getParameters(""); on inputs in the client page like in my case add.jsp, or parameters as inputs on add.jsp passed to the action page of save.jsp, also using JSP forward parameters doesnt work if you put this in the form signature: <FORM ENCTYPE="multipart/form-data"

Because I need to upload a file as well
?

can somebody please help me as I need to upload a file and I need this <FORM ENCTYPE="multipart/form-data" but I also need to read values of input files in the action page from the client page.

 

Thanks

 



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

javax error

Posted by Atif Shahab <as...@mail.bii-sg.org>.
Hi,

I get the following run time error as the root cause

javax.servlet.ServletException: javax/servlet/ServletRequest
 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)

does this mean that I have to install javax?  If so from where
can I obtain it for j2sdk-1.4.1.

code:
-----

jsp:

<%@ page import="java.util.*, java.io.*, com.oreilly.servlet.*,
com.oreilly.servlet.multipart.*" %>
<%
  try
  {
    int DEFAULT_MAX_POST_SIZE = 1024 * 1024;
        MultipartParser parser;
        parser = new MultipartParser( request
                                  , DEFAULT_MAX_POST_SIZE );
  } catch( Exception e )
  {
    out.println( "Sorry! An error was detected" );
  }
%>


The problematic code is

parser = new MultipartParser( request
                                  , DEFAULT_MAX_POST_SIZE );

Regards


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need quick help please

Posted by Kwok Peng Tuck <pe...@makmal.com>.
If you put a input within a form,
<form >
    <input>
</form>
You can acquire the input value through its name.
using request.getParameter("number") ;
You can have many inputs within a form.
Anything outside won't be sent.

Ralph Merrick wrote:

>Does any know out there how to send the value of hidden or non hidden input fields through the action of a form, You know that usually a form has the following signature: 
>
><FORM NAME="add" ACTION="save.jsp" METHOD="POST">
>
>SO lets say you have an hidden input number:
>
><INPUT TYPE="hidden" NAME="number" VALUE="6">
>
>in a page called add.jsp and its signature in the form is <FORM NAME="add" ACTION="save.jsp" METHOD="POST">
>
>so, can you do <FORM NAME="add" ACTION="save.jsp?number="number METHOD="POST">
>
>or something like that , because with JSP for ex. I know you can use 1 of two ways,
>
>Either request.getParameter("field name") in the page like save.jsp which will read inputs from the add.jsp page  or you can use JSP forward as parameters
>
>Does any also know why the request.getParameters(""); on inputs in the client page like in my case add.jsp, or parameters as inputs on add.jsp passed to the action page of save.jsp, also using JSP forward parameters doesnt work if you put this in the form signature: <FORM ENCTYPE="multipart/form-data"
>
>Because I need to upload a file as well
>?
>
>can somebody please help me as I need to upload a file and I need this <FORM ENCTYPE="multipart/form-data" but I also need to read values of input files in the action page from the client page.
>
> 
>
>Thanks
>
> 
>
>
>
>---------------------------------
>Do you Yahoo!?
>New DSL Internet Access from SBC & Yahoo!
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Need quick help please

Posted by bedetrob <be...@bedetinfotech.com>.
I used something like this and it works; here is  an example where I used
it:
			<form target="rbottom" action="detailairkitbeans.jsp">
				<input type="hidden" name="countnode" value="<%=countnode%>">
				<input type="submit" name="sub" value="get more info">
				</form>
But I have not used  <FORM ENCTYPE="multipart/form-data" actually.
Rob

> -----Original Message-----
> From: Ralph Merrick [mailto:javahelpee@yahoo.com]
> Sent: Wednesday, September 25, 2002 4:22 PM
> To: servlet-interest@java.sun.com; jsp-interest@java.sun.com;
> tomcat-dev@jakarta.apache.org
> Cc: tomcat-user@jakarta.apache.org
> Subject: Need quick help please
>
>
>
> Does any know out there how to send the value of hidden or non
> hidden input fields through the action of a form, You know that
> usually a form has the following signature:
>
> <FORM NAME="add" ACTION="save.jsp" METHOD="POST">
>
> SO lets say you have an hidden input number:
>
> <INPUT TYPE="hidden" NAME="number" VALUE="6">
>
> in a page called add.jsp and its signature in the form is <FORM
> NAME="add" ACTION="save.jsp" METHOD="POST">
>
> so, can you do <FORM NAME="add" ACTION="save.jsp?number="number
> METHOD="POST">
>
> or something like that , because with JSP for ex. I know you can
> use 1 of two ways,
>
> Either request.getParameter("field name") in the page like
> save.jsp which will read inputs from the add.jsp page  or you can
> use JSP forward as parameters
>
> Does any also know why the request.getParameters(""); on inputs
> in the client page like in my case add.jsp, or parameters as
> inputs on add.jsp passed to the action page of save.jsp, also
> using JSP forward parameters doesnt work if you put this in the
> form signature: <FORM ENCTYPE="multipart/form-data"
>
> Because I need to upload a file as well
> ?
>
> can somebody please help me as I need to upload a file and I need
> this <FORM ENCTYPE="multipart/form-data" but I also need to read
> values of input files in the action page from the client page.
>
>
>
> Thanks
>
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>