How pass a form parameter value to a same jsp file?

kaiwing18_at_hotmail.com
Date: 01/23/04


Date: 22 Jan 2004 20:51:01 -0800

Hi,

I have a following jsp file called "showAsset.jsp" :

<form action="showAsset.jsp" method="post">
 <tr BGCOLOR=YELLOW>
  
    <td><input name="sort" type="submit" value="Asset_Number" > </td>
    <td><input name="sort" type="submit" value="Description"></td>
    <td><input name="sort" type="submit" value="Quantity"></td>
    <td><input name="sort" type="submit" value="Sub System"></td>
    <td><input name="sort" type="submit" value="Model"></td>
    
  </tr>
 </form>

<% String sort1=request.getParameter("sort");
        String i=" ";
        if (sort1.equals("Asset_Number"))
         i="Asset_Number";
        else if(sort1.equals("Description"))
        i="Description";
        else
        i="Type";
%>

<%=i%>

But when i put it in Tomcat5.0 server, It give me the following error
message:
-------------------------------------------------------------------------------
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

org.apache.jasper.JasperException
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.NullPointerException
        org.apache.jsp.testdb.showAsset1_jsp._jspService(showAsset1_jsp.java:61)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
-------------------------------------------------------------------------------
 
My question is that how can i pass a form value to a same jsp file?

Thank you

Ricky



Relevant Pages

  • RE: Outlook RPC over HTTp deosnt work
    ... try to use RPC over HTTP to connect the Exchange Server. ... What SBS is running on the problematic Server? ...
    (microsoft.public.windows.server.sbs)
  • Re: RPC over HTTP
    ... I will help you with the PRC over Http issue in this thread. ... and go through the Internet option. ... On the Web Server Certificate page shows. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: RPC over HTTP
    ... Are there any other ways of configuring the RPC over HTTP? ... Outlook Web Access, Business Website and so on. ... On the Web Server Certificate page shows. ...
    (microsoft.public.windows.server.sbs)
  • Re: MSAS Licensing Part II
    ... wish to use http access then you must have Enterprise Edition. ... PTS looks at the server name. ... You will note that all of this is totally transparent to the client. ...
    (microsoft.public.sqlserver.olap)
  • Re: RPC over HTTP Question
    ... allow specific traffic transfer and publish some web services to internet. ... On the Web Server Certificate page, ... The wizard automatically configures Exchange, IIS, and the RPC proxy ... >Subject: Re: RPC over HTTP Question ...
    (microsoft.public.windows.server.sbs)