Home > Default > Problem in sending Input to next JSP page

Problem in sending Input to next JSP page

October 11Hits:0
Advertisement
Hi all,
i am having problem with some JSP code. I have a JSP page that take some user input and send it to the next page. Now in those inputs there are some input fileds that needs to be added by the user if he wants to submit those input otherwise he can send the other default inputs. Now the problem is i have some String Array variable for those optional inputs in the next JSP page where they will be redirected. Now if i want to send input other than those optional ones then i get errors saying:
org.apache.jasper.JasperException
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:367)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.NullPointerException
     org.apache.jsp.store_jsp._jspService(store_jsp.java:85)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)I tried to test the empty string on that page as well but it failed. Please help me

Answers

if (request.getParameter("yourParameter") != null)
use the variable
else
ignore the variable or assign a default value
Also be careful with
String yourSingular = request.getParameter("yourParameter");
String[] yourArray = request.getParameterValues("yourArray")
String newSingular = yourSingular;
String fromYourArray = yourArray[0];

Read other 2 answers

Tags:

Related Articles

  • Problem in sending Input to next JSP pageOctober 11

    Hi all, i am having problem with some JSP code. I have a JSP page that take some user input and send it to the next page. Now in those inputs there are some input fileds that needs to be added by the user if he wants to submit those input otherwise h

  • Problem in passing data from one .jsp page to another .jsp pageOctober 11

    i have a problem here Actually i have 2 jsp pages. What im trying to do here is actually i want to pass data from the first jsp page to the second for updating The first jsp page contains data that user wants to update in the form of table. <td><

  • Sending Email From a JSP PageNovember 30

    Hi All, Can anybody tell me how to send email from the jsp page. My requirement is to send email to the user when he click on a button on the jsp page. thanks and regards MSoldierYou need to install an SMTP server, or access an existing one. Contact

  • How can I send email from an JSP page  with HTML format either using jspOctober 11

    hi, I have an jsp page with online application form,after compleating the form if i select submit it will send all the compleated data to the mail id we mentioned in the form tag,for this i am using javascript,but instead of receiving the data in the

  • Problem with displaying BLOB images on JSP page using a servletOctober 11

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that

  • Sending colour from a JSP page into a MySQL database fieldOctober 11

    Dear All, I am working on trying to send different colours into a MySQL database field from a JSP page. This is so that I can represent different pieces of data on my webpage tables in different colours providing status depending on the user request.

  • Problem with access to SipFactory from jsp-pages in JBoss environmentNovember 30

    Hello! I have an installation of the OCMS 10.1.3.3. deployed into a JBoss (jboss-4.0.5.GA) environment. Unfortunately I have a problem with accessing the SipFactory from a jps-page. Encouraged by the "messagesender" example I tried to get an ins

  • Problem catching handle ejb session in jsp pagesNovember 30

    Hello, i'm trying to develop an ejb application. I have created an ejb session stateful in a second ejb stateless : InitialContext ic = new InitialContext(); UserSessionHome home = (UserSessionHome)ic.lookup("UserSessionHome"); UserSession conn

  • Send an email from JSP pageNovember 30

    Hi everyone, What's the easiest way to send an email from a JSP page? Thanks in advance ChrisIf you mean from the client that displays JSP-generated HMTL, generate a "mailTo" tag. If you want to send an E-mail from the server, use the JavaMail A

  • Problem in getting an object in JSP page.October 11

    Hi experts, I am forming a javabean object in the controller(servlet) and passing the object to a JSP page by setting that object as an attribute. But in that jsp page, when i compile, its not able to locate the class. At the beginning itself while t

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.610 s.