Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

musterious jsp error

atzeatze Member Posts: 1
I have written a jsp, and it gives me a strenge error I can't explain.
See:
http://www.java.lwg.at/jsp/Upload.jsp

The stange thing is: Beofore I uploaded it to the webserver, it
worked without any problem on my local tomcat 4 standalone.

Below is the Script:

Thanks 4 your help!

FunkyFlo

<%@ page language="java" import="javazoom.upload.*,java.util.*,lwg.*" %>






Preisliste hochladen


    <%! public String Nr; %>
    <%
    //MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
    Nr = request.getParameter("nr");



    if (MultipartFormDataRequest.isMultipartFormData(request))
    {
    // Uses MultipartFormDataRequest to parse the HTTP request.
    MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);

    Nr = mrequest.getParameter("nr");
    String todo = mrequest.getParameter("todo");





    if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
    {
    Hashtable files = mrequest.getFiles();
    if ( (files != null) || (!files.isEmpty()) )
    {
    UploadFile file = (UploadFile) files.get("uploadfile");
    out.println("<center>Sie haben soeben die Datei mit dem Namen"+file.getFileName()+" erfolgreich upgeloadet!Dateigrösse: "+file.getFileSize()+" bytes)"+"Falls Sie irrtmlich eine falsche Preisliste von Ihrem lokalen PC hochgeladen haben,so wiederholen Sie einfach den Vorgang.");
    uploadDaten udl = new uploadDaten(file.getFileName(),Integer.parseInt(Nr));
    out.println(udl.doIt(request, response));

    // Uses the bean now to store specified by jsp:setProperty at the top.
    upBean.store(mrequest, "uploadfile");
    }
    else
    {
    out.println("
  • A C H T U N G ! !
    ****************************
    Es wurde keine Datei Geladen

    ");
    }
    }
    else out.println("
    todo="+todo);
    }




    %>

Bitte
suchen Sie die entsprechende HTML-Preisliste aus:





<% out.println("<input type="hidden" name="nr" value=""+Nr+"">");
%>




[fenster
schließen
]

[hilfe]










Comments

  • joebeewjoebeew Member Posts: 61
    : I have written a jsp, and it gives me a strenge error I can't explain.
    : See:
    : http://www.java.lwg.at/jsp/Upload.jsp
    :
    : The stange thing is: Beofore I uploaded it to the webserver, it
    : worked without any problem on my local tomcat 4 standalone.
    :
    : Below is the Script:
    :
    : Thanks 4 your help!
    :
    : FunkyFlo
    :
    : <%@ page language="java" import="javazoom.upload.*,java.util.*,lwg.*" %>
    :
    :
    :
    :
    :
    :
    : Preisliste hochladen
    :
    :
    :
    :

      : <%! public String Nr; %>
      : <%
      : //MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
      : Nr = request.getParameter("nr");
      :
      :
      :
      : if (MultipartFormDataRequest.isMultipartFormData(request))
      : {
      : // Uses MultipartFormDataRequest to parse the HTTP request.
      : MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
      :
      : Nr = mrequest.getParameter("nr");
      : String todo = mrequest.getParameter("todo");
      :
      :
      :
      :
      :
      : if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
      : {
      : Hashtable files = mrequest.getFiles();
      : if ( (files != null) || (!files.isEmpty()) )
      : {
      : UploadFile file = (UploadFile) files.get("uploadfile");
      : out.println("<center>Sie haben soeben die Datei mit dem Namen"+file.getFileName()+" erfolgreich upgeloadet!Dateigrösse: "+file.getFileSize()+" bytes)"+"Falls Sie irrtmlich eine falsche Preisliste von Ihrem lokalen PC hochgeladen haben,so wiederholen Sie einfach den Vorgang.");
      : uploadDaten udl = new uploadDaten(file.getFileName(),Integer.parseInt(Nr));
      : out.println(udl.doIt(request, response));
      :
      : // Uses the bean now to store specified by jsp:setProperty at the top.
      : upBean.store(mrequest, "uploadfile");
      : }
      : else
      : {
      : out.println("
    • A C H T U N G ! !****************************Es wurde keine Datei Geladen

      ");
      : }
      : }
      : else out.println(" todo="+todo);
      : }
      :
      :
      :
      :
      : %>
      :
    :
    :
    :
    : : :

    :
    :
    : : :
    : : :
    : : :

    :
    Bitte
    : suchen Sie die entsprechende HTML-Preisliste aus:

    :

    :
    :

    :
    : <% out.println("<input type="hidden" name="nr" value=""+Nr+"">");
    : %>
    :
    :
    :
    :
    :

    :

    :
    :
    : : : :
    [fenster
    : schließen
    ]

    :
    [hilfe]

    :
    :
    :

    :

    :
    :
    :
    :
    :
    :


    Well your getting a servlet exception and numberFormatException. Without seeing the rest of your classes that you are importing. OR knowing what you did in the test environment. Why don't you put a try catch block around the part that you are getting the two errors. Looks like you are trying to parse a null value with Integer.parseInt(); If I could see the your beans then I might be able to help you more.
    Aint nothing to it but to do it!
    Linux: Because rebooting is for adding new hardware!

Sign In or Register to comment.