Checkbox jsp problem

Hello,
Situation:
I a list of checkboxes with the same name but unique value that a user can check if they did something indicated by the checked item. After they check them and click on submit, it goes to a page that then puts a boolean true in a mysql database for the item they checked to indicate they checked the option. When they return to the page, the page uses mysql to see if each item was previously checked and marks it checked if it was.
Problem: What I want is if the user unchecks it and clicks on submit, the next page will receive an attribute showing that a previously checked box was unchecked so that it can then update the mysql database to change the boolean to false. I am royally confused about how to do this. On the next page I was using:
String[] ticket;
ticket = request.getParameterValues("Ticket");
to receive the checkbox settings. Unfortunately, when you uncheck it, it will not (logically) show up.
I also tried:
I created a java bean with a Vector called ticket
protected Vector ticket = new Vector();
and made:
public void setTicket(Vector v) {
ticket = v;
public Vector getTicket() {
return ticket;
I put the bean in the first page and the second page:
<jsp:useBean id="tkt" scope="session" class="com.bti.ticketBean" />
When I did in the page the form goes:
Vector ticket = tkt.getTicket();
When I checked ticket with ticket.elementAt(1) for example, it was null whether I checked something or not. I think I would have the same problem anyway with unchecked boxes returning no value.
Question:
How can I detect if a user clicks off a checkbox and get that information on the page where the form goes after clicking on submit?
David

One way to do this is to store all of the check box values in a cookie as a series of 0's and 1's. When the used submits the form, a javascript function is called to set the cookie. In the servlet you retrieve the cookie, parse it and set all of the database values based on the cookie.
Here is a sample :
<html>
<head>
<title>Set Load Filters</title>
</head>
<body onLoad="loadForm();" >
<center>
   <form>
       <table>
          <tr>
             <td>
                <table>
                     <tr><th>Open State Filters</th></tr>
                     <tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS1">Creating</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS2">Closed</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS3">Opened</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS4">Reopened</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS5">Cancelled</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="OF" VALUE="LOADOS6">Reclosed</td></tr>
                  </table>
             </td>
             <td style="position:relative;top:0px" >
                <table style="position:relative;top:0px" >
                     <tr><th>Proximity State Filters</th></tr>
                     <tr><td><input INPUT TYPE="checkbox" NAME="PF" VALUE="LOADPS1">Will Be Inbound</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="PF" VALUE="LOADPS2">Inbound</td></tr>
<tr><td><input INPUT TYPE="checkbox" NAME="PF" VALUE="LOADPS3">Sitting</td></tr>
                  </table>
               </td>
            </tr>
       </table>
       <p>
       <input type=button name="Exit" value="Close" onClick="closeWindow();" >
       <input type=button name="Reset" value="Reset" onClick="resetForm();" >
       <input type=button name="Save" value="Set Filter" onClick="processForm();" >
   </form>
</center>
</body>
</html>
<Script language=JavaScript src="/PnSReportXML/javascript/LoadFilters.js">
</Script><P>
In the LoadFilters.js file
<!--
   function setCookie (name, value) { document.cookie = name + "=" + escape (value) + ";path=/PnSReportXML/"; }
   function getCookie (name) {
            var dcookie = document.cookie;
            var cname = name + "=";
            var clen = dcookie.length;
            var cbegin = 0;
            while (cbegin < clen) { var vbegin = cbegin + cname.length;
                                    if (dcookie.substring(cbegin, vbegin) == cname) {
                                                var vend = dcookie.indexOf (";", vbegin);
                                                if (vend == -1) vend = clen;
                                                return unescape(dcookie.substring(vbegin, vend)); }
                                   cbegin = dcookie.indexOf(" ", cbegin) + 1;
                                   if (cbegin == 0) break; }
            return null;
           }//end  getCookie ()
   function processForm() { var holdName = document.forms[0].elements[0].value.substring(0,6);
                            var holdValue = new String();
                            for (i = 0; i < (document.forms[0].elements.length - 3); i++)  {
                                     if (document.forms[0].elements.value.substring(0,6) == holdName) {
holdValue = addValue(holdValue, document.forms[0].elements[i]); }
else { setCookie(holdName, holdValue);
holdName = document.forms[0].elements[i].value.substring(0,6);
holdValue = addValue(new String(), document.forms[0].elements[i]); }
}//end for
setCookie(holdName, holdValue);
opener.document.forms[0].submit();
} //end processForm()
function loadForm() { var holdName = document.forms[0].elements[0].value.substring(0,6);
var holdCookie = getCookie(holdName);
var offSet = 0;
for (i = 0; i < (document.forms[0].elements.length - 3); i++) {
if (holdName != document.forms[0].elements[i].value.substring(0,6)) {
holdName = document.forms[0].elements[i].value.substring(0,6);
holdCookie = getCookie(holdName);
offSet = i; }
if (holdCookie == null) { document.forms[0].elements[i].checked = true; }
else { if (holdCookie.substring(i - offSet, (i - offSet) + 1) != 0) { document.forms[0].elements[i].checked = true; } }
}//end for
} //end loadForm()
function resetForm() { for (i = 0; i < (document.forms[0].elements.length - 3); i++) {  document.forms[0].elements[i].checked = true; }
} //end resetForm()
function closeWindow() { window.close(); }
function addValue(inHoldValue, inElement) {
if (inElement.checked) { inHoldValue = inHoldValue + "1"; }
else { inHoldValue = inHoldValue + "0"; }
return inHoldValue; }
//-->
<P>

Similar Messages

  • JDeveloper 3.1 and JSP problems

    Hello everybody.
    I present myself. I am a French student in computer sciences who makes a training course in a French company. (You will excuse the bad quality of my English)
    I have some difficulties in the use of Oracle JDeveloper tool.
    1st problem:
    I encountered this problem during the creation of a JSP page for a simple Intranet application connected to an Oracle database.
    JDeveloper doesnt want to take into account the fact that one of my tables has two primary (composite) keys;(Each of these two keys is primary key of another table). That results on the one hand in an error during the loading of the default edition form (" JBO-25030: Failed to find or invalidate owning entity ") and in addition by impossibility of consulting the recordings of this table according to one of the two key parameters (selected in RowSetBrowser). Nevertheless, this last aspect works within the Oracle Business Component Browser.
    2nd problem:
    Imagine, for example, the following simplified conceptual diagram:
    Racks ---> Files ---> Sheets (they are tables)
    How on a JSP page, can I display in the easiest way (with a JSNavigatorTab and a RowSetBrowser), the recordings of the table Sheets of a particular File, without to use a selection at the table Racks level.
    (You choose directly, with a ComboBox or a RowSetBrowser, a File to display all the corresponding Sheets, without to choose a Rack before.)
    In fact, I try to have an application as simple and ergonomic as possible.
    I thank all those who will be able to inform me on these obscure points which slow down my project considerably.
    Regards.
    Guillaume Vidal
    null

    Hi,
    * For your 1st problem, try to uncheck the "composite association" checkbox in the association object linking your tables together, should work better.
    * For the second one,
    when you create the application module containing the rack/file and sheet views, add the file view at root level (i.e do not use the view link relationship, which would include it as a detail view for the racks view), then add the sheet view through the file/sheet viewLink.
    This way you'll be able to browse the entire file and sheet list in a basic master/detail view.
    Good luck, Remi
    by Guillaume Vidal:
    Hello everybody.
    I present myself. I am a French student in computer sciences who makes a training course in a French company. (You will excuse the bad quality of my English)
    I have some difficulties in the use of Oracle JDeveloper tool.
    1st problem:
    I encountered this problem during the creation of a JSP page for a simple Intranet application connected to an Oracle database.
    JDeveloper doesnt want to take into account the fact that one of my tables has two primary (composite) keys;(Each of these two keys is primary key of another table). That results on the one hand in an error during the loading of the default edition form (" JBO-25030: Failed to find or invalidate owning entity ") and in addition by impossibility of consulting the recordings of this table according to one of the two key parameters (selected in RowSetBrowser). Nevertheless, this last aspect works within the Oracle Business Component Browser.
    2nd problem:
    Imagine, for example, the following simplified conceptual diagram:
    Racks ---> Files ---> Sheets (they are tables)
    How on a JSP page, can I display in the easiest way (with a JSNavigatorTab and a RowSetBrowser), the recordings of the table Sheets of a particular File, without to use a selection at the table Racks level.
    (You choose directly, with a ComboBox or a RowSetBrowser, a File to display all the corresponding Sheets, without to choose a Rack before.)
    In fact, I try to have an application as simple and ergonomic as possible.
    I thank all those who will be able to inform me on these obscure points which slow down my project considerably.
    Regards.
    Guillaume Vidal
    null

  • Help me to solve this Jsp problem

    //Class1.java
    package p1.p2;
    public class Class1 implements Serializable
    private String name1,name2;
    public void setName1(String name)
    name1=name;
    public String getName1()
    return name1;
    public void setName2(String name)
    name2=name;
    public String getName2()
    return name2;
    //Class2.java
    package p1.p2;
    public class Class2
    String name1,name2;
    public String insert(Class1 c1)
    name1 = c1.getName();
    name2 = c2.getName();
    return name1;
    //Class3.jsp
    <%@ page import="p1.p2.*" %>
    <html>
    <form action="/bobby/Class3.jsp" method=post>
    Name1 : <input type=text name="cn1">
    Name2 : <input type=text name="cn2">
    <input type=submit value="Click"/>
    </form>
    </html>
    <%! String a,b,c; %>
    <%
    Class1 c1 = new Class1();
    Class1 c2 = new Class2();
    a=request.getParameter("cn1");
    b=request.getParameter("cn2");
    c1.setName(a);
    c1.setName(b);
    c=c2.insert(c1);
    out.println(c);
    %>
    WHEN I RUN THE JSP PROGRAM I GOT THE FOLLOWING ERROR.TELL ME THE SOLUTION TO SOLVE THIS PROBLEM.
    javax.servlet.ServletException:
    p1.p2.Class2.insert(Lp1/p2/Class1;)Ljava/lang/String;
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl .java:825)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.j ava:758)
    org.apache.jsp.Class3_jsp._jspService(Class3_jsp.java:76)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    root cause
    java.lang.NoSuchMethodError: p1.p2.Class2.insert(Lp1/p2/Class1;)Ljava/lang/String;
    org.apache.jsp.Class3_jsp._jspService(Class3_jsp.java:67)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

    First, please put your code inside code tags. There's a nice little button. All you have to do is paste your code, highlight it and press the little code button. Thanks.
    I had to make some adjustments to your original post. Either you had some closing braces in the wrong place, or you hve no idea what you're doing. I'm going to assume that Class1 is in a file named p1/p2/Class1.java and Class2 is in p1/p2/Class2.java.
    //Class1.java
    package p1.p2;
    public class Class1 implements Serializable
        private String name1,name2;
        public void setName1(String name)
            name1=name;
        public String getName1()
            return name1;
        public void setName2(String name)
            name2=name;
        public String getName2()
            return name2;
    //Class2.java
    package p1.p2;
    public class Class2
        String name1,name2;
        public String insert(Class1 c1)
            name1 = c1.getName();
            name2 = c2.getName();
            return name1;
    //Class3.jsp
    <%@ page import="p1.p2.*" %>
    <html>
    <form action="/bobby/Class3.jsp" method=post>
    Name1 : <input type=text name="cn1">
    Name2 : <input type=text name="cn2">
    <input type=submit value="Click"/>
    </form>
    </html>
    <%! String a,b,c; %>
    <%
        Class1 c1 = new Class1();
        Class1 c2 = new Class2(); //<-- problem here, do you see it?
        a=request.getParameter("cn1");
        b=request.getParameter("cn2");
        c1.setName(a);
        c1.setName(b);
        c=c2.insert(c1);
        out.println(c);
    %>Note the I highlighted the problem above. HTH.

  • JSP problem after PDF Form Submit

    Hi,
    Our project team is using a PDF with Acrobat Form fields behind it to post form data to a java servlet, where it is parsed and written to a legacy system.
    Our problem: when we return a jsp confirmation page back to the user, we are getting intermittent responses - sometimes the user will see the page, sometimes not. Also of note - the URL address location in the browser is being changed to "C://TEMP/xxxxxx.html", instead of showing "http://myserver/myapp/confirmPage.jsp". In effect, it doesn't retain the server location from which the form data was submitted - instead, after the jsp on that server is rendered into html, it is being written to a temp location on the local hard drive as an .html page, then displayed from there.
    In my debug testing, I have bypassed the bulk of my application code, submitting into the servlet and returning the jsp right back to the user. It works properly when submitted from an HTML page, but goes to the C://TEMP... route when submitted from the PDF. Therefore, I can conclude that the bug is not in our java code and is not in the jsp code.
    On our PDF we are using an Adobe script submitForm() function, naming our servlet to send to (without appending #FDF on it) and specifying "false" as our second parameter, since we are passing the data as an HttpRequest instead of as FDF data.
    I suspect the problem may be caused by some differences in the headers in the HttpRequest object coming from the PDF. In comparing the Request headers from the PDF submit and those from an HTML page submit:
    From the PDF:
    content-type = application/x-www-form-urlencoded
    user-agent = Mozilla/4.0 (compatible; Adobe Acrobat Control Version 5.00 for ActiveX)
    From an HTML submit:
    content-type = text/html
    user-agent = Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
    I have tried explicitly setting the headers to match those coming in from an HTML submit but this doesn't seem to make a difference.
    Has anyone experienced a similar problem? Any thoughts?
    jander

    This is a bug from Acrobat !
    The turnover is to send a FDF document with the file tag (/F) referencing the jsp page you want to display

  • Xml/html to jsp - problem with quotes in attribute values

    I am trying to convert a static html document into a jsp using an xsl stylesheet, but run into problems trying to use the jsp expression syntax inside of attribute values.
    Here is a sample of the source file:
    <input type="text" name="firstName" value=""/>
    Here is what I want the resulting jsp file to look like:
    <input type="text" name="firstName" value="<jsp:expression>customer.getField("firstName") </jsp:expression>">
    Here is what part of my stylesheet looks like:
    <xsl:template match="input">
    <xsl:copy>
    <xsl:copy-of select="@type"/>
    <xsl:copy-of select="@name"/>
    <xsl:attribute name="value">
    <xsl:text disable-output-escaping="yes"><jsp:expression></xsl:text>
    <xsl:text disable-output-escaping="yes">customer.getField(</xsl:text>
    <xsl:text disable-output-escaping="yes">"</xsl:text>
    <xsl:value-of select="@name"/> ")
    <xsl:text disable-output-escaping="yes">")</xsl:text>
    <xsl:text disable-output-escaping="yes"></jsp:expression></xsl:text>
    </xsl:attribute>
    </xsl:copy>
    </xsl:template>
    The problem i have is with the <%= customer.getField("firstName") %>. I have tried several different ways of inserting the double quotes around firstName, but no matter what I try, it always uses the entity reference instead of actually putting the " character. The jsp container will not accept the entity.
    I am assuming that the problem is with trying to place double quotes inside of an attribute value. Any ideas how to get around this?
    Thanks
    David

    Which App Server are you using?
    You should just be able to escape the double quotes.
    If that doesn't work, it's a bug in the app-server.
    Alternatively, you can use single quotes around the
    attribute value.
    Hope that helps,
    AlexSorry, I'm an idiot. By escaping you meant the unicode character escape "\u0022". I had not tried that. However, once i realized what you meant, I tried it, and it worked. Thanks for your help.
    David

  • Iplanet webserver 4.1 JSP problem

    Hi I am using iplanet webserver 4.1, whenever i change my jsp file, i have to restart my webserver instance otherwise ia gm getting error..is ther any way i can prevent to restart the webserver?

    this is the script.
    mv /logs/https-`uname -a`-443/access /logs/https-`uname -a`-443/access.yesterday
    compress /logs/https-`uname -a`-443/access.yesterday
    /opt/netscape/server4/https-`uname -a`-443/restart
    the moving and compressing works properly but the restart command doesn't actually kill the and restart the httpd process, and doesn't create the access or error log.
    The restart is a graceful restart will not ask for password, the same setting was working fine for a long time. it suddenly started to give this problem.
    the webserver is working fine(taking requests ,etc) except that the log files are not being written.
    i did a truss and the data collected is above i see that it is giving error #91 ERESTART many times
    there is another server with same settings which is working fine the only difference is that its patch level is lower.

  • Servlet/jsp problem

    hello i am using netbeans to create a simple login system using a servlet and a jsp. the jsp has the following code:
    <form action="login" method="get">
    <br>UserID <input type="text" name="userID" size="20" maxlength="20">
    <br>Password <input type="password" name="password" size="20" maxlength="20">
    <br><input type="submit" value="Login">
    </form>
    the servlet name is login and located under src/java/login.java
    however when i run it its just giving me this msg that it cannot find the servlet:
    type Status report
    message Servlet login is not available
    description The requested resource (Servlet login is not available) is not available.
    does anyone know what the problem might be?

    How have you defined this servlet in your web.xml ?
    For example it should be something like this:
        <servlet>
            <servlet-name>SomeServletAlias</servlet-name>
            <servlet-class>servletpackagename.ServletClassName</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>SomeServletAlias</servlet-name>
            <url-pattern>/servleturlpattern</url-pattern>
        </servlet-mapping>If you have the URL Pattern as: /servleturlpattern , then in your form's action put action="/servleturlpattern" and not action="servleturlpattern"
    Where ever you reference the servlet, the URL for the servlet should match exactly as you specify it in the URL-Pattern. Otherwise it wont work.

  • Please Urgent sound applet in jsp problem

    Hi please any body hekp me urgently.
    I have a problem while playing a sound applet in the jsp file the error is class not found.
    My applet class file is in the com.mypack.common
    its code is
    public class PlayErrorSoundApplet extends Applet
    public PlayErrorSoundApplet()
    public void init()
    public void playSound()
    String soundObj = getParameter("soundObj");
    AudioClip sound = getAudioClip(getDocumentBase(), "success.wav");
    sound.play();
    in the jsp i have written the code like this
    <applet codebase="com.mypack.common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
    <param name="soundObj" value="error.wav">
    </applet>
    In the applet console i got class not found error.
    please help me .....advanced thanks......

    actually, codbase is a directory. so
    <applet codebase="com/mypack/common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
    <param name="soundObj" value="error.wav">
    </applet>this means you have something like
    pacakge com.mypack.common
    public class PlayErrorSoundApplet {
    Make sure to put the html file in the root directory of the package structure
    /myhtmlfile.html
       /com
          /mypack
               /common
                    PlayErrorSoundApplet.class                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Custom tags in jsp - problems with import in java pgm

    Hi,
    I am new to JSP and am facing some problems.
    I am trying to compile the foll. java program and it is giving an error saying 1."Package javax.servlet.jsp does not exist", 2."Package javax.servlet.jsp.tagext does not exist".
    I am using 1.j2sdk1.4.1_02, 2.j2sdkee1.3.1,and 3.Tomcat 4.1
    My java_home=C:\j2sdk1.4.1_02
    j2ee_home=C:\j2sdkee1.3.1
    path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api;c:\jakarta-ant-1.5.1\bin
    classpath=c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api
    can anybody help me with it?
    Regards,
    newtojsp
    import java.io.IOException;
    import java.util.Date;
    import doc.api.javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TestTag extends TagSupport
         public int doStartTag () throws JSPTagException
              String dateString = new Date().toString ();
              try
                   JspWriter out = page.context.getOut ();
                   out.println ("Welcome to the Loan Dept" + " <br>");
                   out.println ("Today is:" + dateString + "<br>");
                   return SKIP_BODY;
              } catch (IOException ee)
                   throw JspTagException ("Error Encountered");
         public int doEndTag () throws JSPTagException
              return EVAL_PAGE;

    I got the solution for this.
    Thanks
    Newtojsp

  • JSP PROBLEM...THEORETICAL QUESTION

    Hi as you all know by now im quite new to jsp and have struggled so far to get something decent working but now that i have im happy :D
    quick question for you all...
    imagine this scenario. when you submit an application for something...i.e. a job...your application status is 'pending' and when moved to the interview stage the status is changed to 'interview' and then if successful changes to 'job offer'
    these 3 'status' would be done as final int data types in java...ive done it before and thats not a problem. however how is one to approach that using jsp?? can it be done...if so, how??
    also when the user logs in to check the current status of his/her application they should be presented with this status either pending/interivew/job offer.
    any ideas??
    at the moment all i have done is an application submission which gets stored in an access database. i am nowworking on the part which manipulates the submitted applications according to criteria
    thanks!

    Level_ID Level_Name
    0 Pending
    1 Interview
    2 Offer
    3 Rejection
    how would i make a user who logs in to see his status
    as the word pending rather than 0?? i.e. how can i
    point the Level_ID in Login_Details table to find its
    corresponding Level_Name in the Levels table?Create a HashMap at init of your Main Servlet that is populated by this data, keyed by Integer. Make this table reloadable via an HTTP call, that way if you want to update the names you can do so without needing to restart your webserver.
    Then when its time to show the name, rather than the number, do :
    <%= servlet.statusTable.get( new Integer( user.getStatus() ) ) %>
    Probably would be a good idea to put this into a method so you can verify that the object exists, etc., call it showStatus(user)

  • Checkbox convertion problem in screen painter

    Hi experts,
    I would like to convert an field from DD char 1 in checkbox in the screen painter but the field is locked in my screen painter. I can't conert it to checkbox or radiobutton.
    -> The field is from an enhancement of an standard IT.
    Is their some option to unlock field in the screen painter ?
    Thanks,

    Hi,
    first check u are declare text boxes in TOP INCLUDE if OK, then change data type text to integer. it may be problem of it, can u post u r code where u assigned a value in text box.
    Abhilash

  • Paper Layout in Report JSP - problem with anchors

    Hi,
    I am using an anchor to connect two frames. The frames are vertically expandable and horizontally fixed. When I run the report (PDF) as an rdf, I receive no errors, however when running the same report as a JSP, I get the following error : 'Object can never fit in within....<frame-name>'.
    What could be the reason? Is it a bug?
    Thanks,
    Bharat

    hi,
    i've not heared about this particular issue, but i think it might be a good idea to open a tar with oracle support. it could be, that some properties get mixed up in your particular case when saving the report as JSP and therefore the RDF works and the JSP doesn't. it is certainly not a generic issue, otherwise we would have already heared about it.
    another idea would be to apply the latest patchset (9.0.2.2) that contains a lot of fixes and it might fix your problem as well.
    regards,
    philipp

  • Servlet/JSP problems with WL 4.51

    Hi all
              I have a set of Servlets and JSPs running on NewAtlanta's ServletExec
              servlet engine. I am currently porting them to WebLogic. I am facing a
              few problems. I do not want to change any of my HTML/JSP/Java files
              immediately. I want the same files to work in WL as it is. Pl help.
              1. The servlets in ServletExec used to be invoked as
              http://host/servlet/servletName. But in weblogic they are invoked
              as http://host/servletName. I tried registering the servlet names
              in weblogic.properties as
              weblogic.httpd.register.servlet/XServlet=com.foo.XServlet
              weblogic.httpd.initArgs.servlet/XServlet=param=value
              Now I can call this servlet as http://host/servlet/XServlet and so
              I dont have to change any html/JSP files. Will this cause any
              problems in the future?
              2. Since we used to run ServletExec on IIS, we created a virtual
              directory called /jsp in IIS under which we had all the html and
              JSP files. Our servlets will get the http requests, get data from
              database, put the results in session/request variables and dispatch
              it to appropriate JSP page. So, all our servlet code looks like
              this:
              RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher("/jsp/test.jsp");
              dispatcher.forward(request, response);
              How do I make this code work with WebLogic? Is there any way to
              create virtual directory and make it work like in IIS?
              Thanks for any help.
              shiv
              [email protected]
              

    You might try
              weblogic.httpd.register.jsp/*.jsp=weblogic.servlet.JSPServlet
              but a better/ easier way would be to just move all of your jsp files to a 'jsp'
              subdirectory beneath public_html
              -rrc
              Shiv Kumar wrote:
              > Hi all
              >
              > I have a set of Servlets and JSPs running on NewAtlanta's ServletExec
              > servlet engine. I am currently porting them to WebLogic. I am facing a
              > few problems. I do not want to change any of my HTML/JSP/Java files
              > immediately. I want the same files to work in WL as it is. Pl help.
              >
              > 1. The servlets in ServletExec used to be invoked as
              > http://host/servlet/servletName. But in weblogic they are invoked
              > as http://host/servletName. I tried registering the servlet names
              > in weblogic.properties as
              >
              > weblogic.httpd.register.servlet/XServlet=com.foo.XServlet
              > weblogic.httpd.initArgs.servlet/XServlet=param=value
              >
              > Now I can call this servlet as http://host/servlet/XServlet and so
              > I dont have to change any html/JSP files. Will this cause any
              > problems in the future?
              >
              > 2. Since we used to run ServletExec on IIS, we created a virtual
              > directory called /jsp in IIS under which we had all the html and
              > JSP files. Our servlets will get the http requests, get data from
              > database, put the results in session/request variables and dispatch
              > it to appropriate JSP page. So, all our servlet code looks like
              > this:
              >
              > RequestDispatcher dispatcher =
              > getServletContext().getRequestDispatcher("/jsp/test.jsp");
              > dispatcher.forward(request, response);
              >
              > How do I make this code work with WebLogic? Is there any way to
              > create virtual directory and make it work like in IIS?
              >
              > Thanks for any help.
              > --
              > shiv
              > [email protected]
              Russell Castagnaro
              Chief Mentor
              SyncTank Solutions
              http://www.synctank.com
              Earth is the cradle of mankind; one does not remain in the cradle forever
              -Tsiolkovsky
              

  • JSP problem

    Hello,
    I have a problem regarding jsp.
    I have a html page called performance.html which has a link to month.jsp page.
    When the user enters Number 1, Number 2 into the text boxes in the jsp page and click submit, it must be displayed on the 1st month colum of the table in performance.html page. (one under the other)
    Give your sugessions on how to write the jsp code to implement the above.
    Here is my code.
    Performance.html
    <form method="POST" action=" ">
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
    <td width="25%"> </td>
    <td width="25%">1st month</td>
    <td width="25%">2nd month</td>
    </tr>
    <tr>
    <td width="25%">Number 1</td>
    <td width="25%"> </td>
    <td width="25%"> </td>
    </tr>
    <tr>
    <td width="25%">Number 2</td>
    <td width="25%"> </td>
    <td width="25%"> </td>
    </tr>
    </table>
    <p> </p>
    <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    month.jsp
    <form method="POST" action="PrintToTable.jsp">
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="44%" id="AutoNumber1">
    <tr>
    <td width="19%">Number 1</td>
    <td width="19%"> </td>
    <td width="17%"><input type="text" name="T1" size="10"></td>
    </tr>
    <tr>
    <td width="19%">Number 2</td>
    <td width="19%"> </td>
    <td width="17%"><input type="text" name="T2" size="10"></td>
    </tr>
    </table>
    <p> </p>
    <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    Please help me.

    month.jsp submits PrintToTable.jsp - what is PrintToTable.jsp suppose to do?

  • REPOST: JSP problems!!!

    Sorry about the repost,
    I have been trying to get my JSP to work all night but with no success. At the moment it outputs the total set of data which I presume means that my queries aren't being executed properly. They work fine when typed directly into MySQL. Can anyone see the problem?
    The methods that I am using and the jsp code are displayed below,
         public void roomsBooked(String arrivalDate, String departureDate) throws SQLException, Exception
              if (con != null)
                try
                  Statement checkBookings = con.createStatement();
                  String query = ("CREATE TEMPORARY TABLE roomsoccupied "
                        + "SELECT roombooked.room_id FROM roombooked, booking "
                        + "WHERE "
                        + "roombooked.booking_id = booking.booking_id "
                        + "AND "
                        + "booking.arrival_date <  '" + departureDate +"'"
                        + "AND "
                        + "booking.departure_date >  '" + arrivalDate +"'"
                 checkBookings.executeUpdate(query);
                catch (SQLException sqle)
                  error = ""+sqle;
                  throw new SQLException(error);
                catch (Exception e)
                              error = ""+e;
                              throw new Exception(error);
              else
                error = "Exception: Connection to database was lost.";
                throw new Exception(error);
    public ResultSet roomsAvailable() throws SQLException, Exception
              if (con != null)
                try
                  Statement checkAvailability = con.createStatement();
                  String query = ("SELECT rooms.room_no FROM rooms "
                        + "LEFT JOIN roomsoccupied ON rooms.room_no=roomsoccupied.room_id "
                        + "WHERE roomsoccupied.room_id IS NULL;"
                 rs = checkAvailability.executeQuery(query);
                catch (SQLException sqle) {
                  error = ""+sqle;
                  throw new SQLException(error);
                catch (Exception e) {
                              error = ""+e;
                              throw new Exception(error);
              else {
                error = "Exception: Connection to database was lost.";
                throw new Exception(error);
           return rs;
      }JSP PAGE
    <%
          javaBean.connect();
          String arrivalDate =  request.getParameter("ArrivalDate");
          String departureDate =  request.getParameter("DepartureDate");
          javaBean.roomsBooked(arrivalDate, departureDate);
          ResultSet rs = javaBean.roomsAvailable();
          while(rs.next())
          {  %> Room number <%= rs.getString(1) %>
           <P><% }
          javaBean.disconnect();
    %>

    Well here is the original code with the PreparedStatements,Looking at this code, I'd say you have to learn what PreparedStatements are for:
    try
        String sql = "CREATE TEMPORARY TABLE roomsoccupied "
                          + "SELECT roombooked.room_id FROM roombooked, booked, booking "
                          + "WHERE "
                          + "roombooked.booking_id = booking.booking_id "
                          + "AND "
                          + "booking.arrival_date <  ? "                           
                          + "AND "
                          + "booking.departure_date > ?";
        PreparedStatement roomsBooked = con.prepareStatement(sql);
        roomsBooked.setDate(1, arrivalDate);   // This is what I mean by letting PS escape the dates for you
        roomsBooked.setDate(2, departureDate);
        roomsBooked.execute();
        roomsBooked.close();
    } catch (SQLException sqle)
        sqle.printStackTrace();
        System.err.println("SQL state: " + sqle.getSQLState());
        System.err.println("SQL error: " + sqle.getErrorCode());
    I'm assuming that you're passing java.sql.Dates to the method.  That's what PreparedStatement will require.  I'm also assuming that the columns in that table are of type date.
    >
    The queries work fine when run directly on the command
    line into MySQL and I have used System.out.println
    statements which tell me that both methods execute.
    Which leads me to believe that the MySQL code in my
    methods just isn't being entered into MySQL properly
    which is why it is returning NULL.
    Maybe.  It's good that the queries run in the MySQL command shell, but your problem is the JDBC code.
    As far as the temporary table is concerned, one is
    created for each connection to the database and it's
    results depend on each users query, which is why it is
    a temporary table rather then a permanent one. The
    results of each users temporary table are then used by
    the second method to obtain the needed results which
    should then be output by the JSP.
    I'll bet this could be done with a JOIN or a VIEW instead of a temporary table.  Sounds like the sign of a bad design, IMO. - MOD

Maybe you are looking for

  • Is there is a way to have a link from purchase order to cost center report.

    Is there is a way to have a link from purchase order to cost center report. I am meaning kind of: Standard way to customized this link? or User exit to have this link in place or Any other solution Thanks

  • 1st Gen Imac G5 Question

    I own a 1st Gen Imac G5. I just recently purchased the Apple VGA Display Adapter hoping I would be able to use an external monitor as an extention of my desktop... after looking through the system preferences I realized there was no such option. I th

  • KMC - DB migration fails (EP6- NW)

    Hi I am migrating an SP2 portal with heavy KMC content into a NW environment. I am currently using the KMC Migration Tool (Patch 8) and I have successfully completed the first 2 steps (Reports and ETC). Now I am at step 3 (DB Migration). After pressi

  • Cards app: how to delete saved cards

    In the Cards app: Ow can I delete cards that I have previously saved but no longer want anymore? I can't find a way to do it anywhere, please help me out! And if it isn't an option, why the heck not? I've only sent a total of three cards, but I have

  • Again : Changing Delivery Date automaticly when CARDCODE is validated...

    Strugging again. Nothing I'm trying seems to work. With this : It never gets in if (pVal.EventType == BoEventTypes.et_VALIDATE && pVal.ItemUID == FortSum.SAPFramework.Enums.SO_FIELDS.B1_CARDCODE && pVal.ItemChanged == true && pVal.ActionSuccess == tr