Jump to content
Changes to the Jaspersoft community edition download ×

Custom JSP - passing parameters - ERROR: java.lang.IllegalArgumentException: An id is required to lo


robidomadenik

Recommended Posts

Hello.

 

I'm quite new to JasperServer and JSP, so i have a question.....

I've imported my report to JasperServer and I've also set a few parameters on it. Works fine.

Then, I've made a custom JSP page for customizing input window for input parameters, which saves this parameters to mySQL database and on next reload loads it to this custom made windows for input parameters.

 

Now....when I run this JSP from Netbeans IDE 6.0, everything works OK, BUT when I try to do this on JasperServer, input window appears normally, I put in the parameters and when I click on my OK (submit) button, I get this error:

 

java.lang.IllegalArgumentException: An id is required to lookup a FlowDefinition

 

I'm stucked here now for a few days, googled everything, but I can't find anything useful.

Can someone please help?

Thanks a lot,

Robi

Code:
-------------index.jsp---------------------------------------------------------<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <html> <head>   <TITLE><center>Grosuplje</center></TITLE></head> <body> <form action="ShraniParametre.jsp" method="POST"><h1>Komunala Grosuplje </h1><% try {    String connectionURL = "jdbc:mysql://sql.bass.si:3306/grosuplje"; Connection connection = null; Statement statement = null;Statement statement1 = null;ResultSet rs = null;Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "bass", "bass");statement = connection.createStatement();rs = statement.executeQuery("SELECT * FROM TEMPGrosuplje");while (rs.next()) {  %><table border="1" width="300">  <tr width="400">    <td width="250">Odjemno mesto:</td>    <td width="75"><input type="text" name="txtOMOd" value ="<%=rs.getString("OM_Od")%>" size="12" /></td>    <td width="75"><input type="text" name="txtOMDo" value ="<%=rs.getString("OM_Do")%>" size="12" /></td>  </tr>  <tr width="400">    <td width="250"><label for="UlicaOd">Ulica:</label></td>    <td width="75"><input type="text" name="txtUlicaOd" value ="<%=rs.getString("Ulica_Od")%>" size="12" /></td>    <td width="75"><input type="text" name="txtUlicaDo" value ="<%=rs.getString("Ulica_Do")%>" size="12" /></td>  </tr>  <tr width="400">    <td width="250"><label for="ObcinaOd">ObÄina:</label></td>    <td width="75"><input type="text" name="txtObcinaOd" value ="<%=rs.getString("Obcina_Od")%>" size="12" /></td>    <td width="75"><input type="text" name="txtObcinaDo" value ="<%=rs.getString("Obcina_Do")%>" size="12" /></td>  </tr><tr width="400">    <td width="250"> </td>    <td width="75"> </td>    <td width="75"> </td>    </tr><tr>    <td colspan="3"><input type="submit" value ="OK" name="OK" /></td>     </tr></table><%}rs.close();String OMOd = request.getParameter("txtOMOd");String OMDo = request.getParameter("txtOMDo");String UlicaOd = request.getParameter("txtUlicaOd");String UlicaDo = request.getParameter("txtUlicaDo");String ObcinaOd = request.getParameter("txtObcinaOd");String ObcinaDo = request.getParameter("txtObcinaDo");              if(!connection.isClosed())%><font size="+2" color="green"><% out.println("OK!");connection.close();}catch(Exception ex){%></font><font size="+3" color="red"><%out.println("Not OK!");}%></font</form></body> </html> -------------------------------------------------------------------------------------------------ShraniParametre.jsp----------------------------------------------<%--     Document   : ShraniParametre    Created on : 6.6.2011, 13:02:14    Author     : robid--%><%@page contentType="text/html" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   "http://www.w3.org/TR/html4/loose.dtd"><%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <html>    <head>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        <title>Shrani Parametre</title>    </head>    <body><% String connectionURL = "jdbc:mysql://sql.bass.si:3306/grosuplje"; Connection connection = null; Statement statement = null;Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "bass", "bass");    String Ood = request.getParameter("txtOMOd");      String Odo = request.getParameter("txtOMDo");      String Uod = request.getParameter("txtUlicaOd");      String Udo = request.getParameter("txtUlicaDo");      String Obod = request.getParameter("txtObcinaOd");      String Obdo = request.getParameter("txtObcinaDo");                    statement = connection.createStatement();    statement.executeUpdate("UPDATE TEMPGrosuplje SET OM_Od = " + Ood + ", OM_Do = " + Odo + ", Ulica_Od = " + Uod + ", Ulica_Do = " + Udo + ", Obcina_Od = " + Obod + ", Obcina_Do = " + Obdo );    connection.close();    %><%response.sendRedirect("index.jsp");%></body></html>
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...