Request in JSP page

Hi
it east can be elementary what i ask but as even 2 days i test
so
it's just a request to acces base in JSP page
at this level i get an integer variable numope who had value, and the the name of the column is Nope
so the request is ("select * from body where Nope='numope' ");
i tryed also ("select * from body where Nope=numope ");
but the both it doesn't return a result, but if i test this with a variable it works
the test is something like ("select * from body where Nope=49 ");
i get a result i need
thanks

Construct the SQL string something like this:
"select * from body where Nope=" + numope

Similar Messages

  • Getting troubles in getting the JSP page

    hi friends,
    Let me tell u first i m using Tomcat 5.5 and Internet Explorer .
    I think i have some problem in Tomcat. Coz I have made an JSP page which has a simple coding as follows
    <%@ page language="java" contentType="text/html" %>
    <html>
    <body bgcolor="green">
    <font size=5 color="red">
    <%! int i=5%> <%= "The i value is  "+i %>
    <h1>Let's cheak if its working or not. </h1>
    </font>
    </body>
    </html>Let me tell u i don't want to do anything ,except getting valid response from a JSP page.
    i believe nothing is wrong with this page but when ever i m giving request for JSP page i m getting a blank page(a page of white colour though i have set bgcolor to be 'green'). But if i m giving request for Servlet and HTML pages then it's running fine . Can anyone advice me what to do.
    Let me tell u one more thing i.e when i m giving request 4 a JSP page the corresponding Servlet (the java file as well as .class file) is being formed by Tomcat. But still i m not getting my output.
    I hope i m clear in communicating my problem.
    Please suggest some solution what to do.
    with regards
    Arunabh

    save the above as test.jsp ..place it in webapps....
    important thing is check the path name u give in ur
    url
    http://10.32.246.55:8080/Activit/tex.jsp... in
    my system i have a folder called Activit in webapps
    so no need to mention webapps in url.... mention the
    ip address ..if u r runnin the application on the
    system where tomcat is installed then instead of ip
    address u can mention as localhost .. do
    mention port no. also ... think by default port no is
    8080...
    it should work cauz it worked in my systemIf it worked in ur system then i suppose somthing is wrong with my tomcat. Is it so ?????
    Arunabh

  • Using swing elements in JSP pages

    I am developing a web application using jsp pages. In this application i want to display some information in a seperate window. For this i created a class which extends JFrame. This class makes also use of the singleton principle.
    In the jsp i use the following code (singleton class is called Statistics.class:
    <%
    /** statswindow try
    JFrame eTAFframe = Statistics.getInstance();
    eTAFframe.pack();
    eTAFframe.setLocation(485, 420);
    eTAFframe.setVisible(true);
    /*end statswindow try */
    %>
    After deployting the application on an Iplanet Application Server this code does create a window displaying the right information. The problem is that it opens this windows on the system i used to deploy the application and not on the machine requesting the jsp page.
    Question:
    How do you get this window to be displayed on the requesting machine, preferably without using an applet approach?
    Any code examples showing the use of swing elements in jsp pages are welcome.

    I understand the desire to not use an applet. Have you tried an html pop-up? This will create a separate http request through to your server on the user's same session. This allows your server to do the required processing to display the data to the user via html.
    Use the target="_blank" attribute of the anchor tag, or a window.open JavaScript method.

  • Slow response time for JSP pages under iAS 6.0 SP4

    Hi,
    I got an application deployed on iplanet app server 6.0 SP4 on solaris
    2.8. Using a single kjs engine and lite sessions. kjs memory size is
    min 256 and max 256 megs. but verbose:gc shows memory is 98% free.
    when i restart the app server, all JSP pages are really rendered fast.
    After a while (1 or 2 days), the time to service the same request to
    JSP pages is getting much longer (even with JSP pages having only
    static content in them). CPU is idle ... It just takes time. KXS log
    shows requet is taking like 2-4 seconds instead of about 150 milli
    secs when the engine is just restarted.
    Now if i call a servlet (which do not dispath to a JSP), the response
    time is ok! Memory is ok. It looks like its related to JSP pages
    only.
    Anyone having an idea what the problem could be? One conig param is
    the JSP page cache in iASAT. Default value is 10. What is a correct
    setting for production? I have 4 different web app deployed in the
    same server instance.
    Tanks a lot for your input
    Andre Paradis

    Andre,
    I have found the answer to my problem and perhaps yours. It seems that I18N (internationalization) in SP4 may have a performance bug in it.
    My soak tests show that with i18N checked in the iAS Admin Tool, testing the fortune cookie sample application with light load (1 request / sec) resulted in a kxs response time initially of 15ms, however this response time increased by roughly 1% per request (i.e after 100 requests the response time had more than doubled).
    Switching I18N off yielded a steady 7ms kxs response time from the fortune cookie application.
    I would add that I turned I18N on AFTER the installation procedure.
    Is this a known issue in SP4? Is there a patch?
    regards,
    Owen

  • Displaying a jsp page content as a pdf...

    HI,
    I am writing a simple jsp page.When I request that jsp page I want to display it in a pdf format in the browser. I have given the content type as "application/pdf", but still its showing as a normal web page. But when I am making the content type as "application/vnd.ms-excel", its working and opening in the excel sheet. Plz help me..how to display the jsp page in pdf format.
    the tag i am using is..
    <%@ page language="java" contentType="application/pdf" %>

    u want to show a pdf file in a jsp??
    so u have to write a servlet that that writes this file to the response

  • Tomcat webapp jsp pages are blanc

    Hi,
    I'm using tomcat 5.5.17 and it's working fine. When I deploy my webapp to,I can start Tomcat , but when I request a jsp page, no matter which one it is, it returns a blanc page.
    Can someone help me?
    Thanks.
    Regards,
    Michiel.

    Hi,
    My Tomcat is configured well. Other webapps run just fine.
    Within my war file that Ideploy to this Tomcat installation there are several jar files included as a reference to them.Because at first I included as well the javax.servlet.jar and the javax.servlet.jsp.jar which Tomcat uses as well, I thought that there might bea conflictas I describedin my first post. But I removed them and there is no change (I stopped Tomcat before).
    Thanks.
    Michiel.

  • In JSP pages request.getParameter returns null

    There are two jsp's,the first JSP has 1 textbox inside the form tag.We input the values in the textbox and submit.
    Code :Ist jsp
    <BODY>
    <HEAD>
    function validate()
    document.add.submit();
    </HEAD>
    <FORM name="add" method="post" action=/dir/two.jsp" >
    <TABLE width="37%" border="0" align="center" class="c4f3">
    <TR>
    <TD class="c4">Rating</TD>
    <TD><input type=text name="rating"></TD?
    </TR>
    <TR>
    <TD align=center><INPUT type="button" name="submitadd" value="Submit" onClick="validate()" </TD>
    </TR>
    </TABLE>
    </FORM>
    </BODY>
    After the submit it goes to the 2nd JSP page .
    code:2nd Jsp
    <%
    String Rating=request.getParameter("rating");
    out.println(" Rating "+Rating);
    %>
    The 2nd JSP pages gets the values by request.getParameter.When I use method='post' in Ist JSP ,even if I enter values in the textbox, it prints null. But when I give method="get" , it prints the value.
    Pls let me know if there is any problem in the code or its the problem due to webserver configuration.Also suggest the solution to over come this problem.
    Thanks

    If I'am right you have misplaced the opening body-tag of your first jsp-page.
    The opening body-tag should follow after the closing head tag .
    The structure of your HTML-code should look like this:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

  • Unable get complete filepath from jsp page using request.getParameter()

    Hey all,
    i am actually trying to get the selected file path value using request.getParameter into the servlet where i will read the (csv or txt) file but i dont get the full path but only the file name(test.txt) not the complete path(C:\\Temp\\test.txt) i selected in JSP page using browse file.
    Output :
    FILE NAME : TEST
    FILE PATH : test.txt
    Error : java.io.FileNotFoundException: test.txt (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileReader.<init>(FileReader.java:55)
    at com.test.TestServlet.processRequest(TestServlet.java:39)
    at com.test.TestServlet.doPost(TestServlet.java:75)
    JSP CODE:
    <%@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">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>DEMO SERVLET</title>
    </script>
    </head>
    <body>
    <h2>Hello World!</h2>
    <form name="myform" action="TestServlet" method="POST"
    FILE NAME : <input type="text" name="filename" value="" size="25" /><br><br>
    FILE SELECT : <input type="file" name="myfile" value="" width="25" /><br><br>
    <input type="submit" value="Submit" name="submit" />
    </form>
    </body>
    </html>
    Servlet Code :
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException, FileNotFoundException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    try {
    String filename = request.getParameter("filename");
    out.println(filename);
    String filepath = request.getParameter("myfile");
    out.println(filepath);
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet TestServlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Servlet TestServlet at " + request.getContextPath() + "</h1>");
    if (filepath != null) {
    File f = new File(filepath);
    BufferedReader br = new BufferedReader(new FileReader(f));
    String strLine;
    String[] tokens;
    while ((strLine = br.readLine()) != null) {
    tokens = strLine.split(",");
    for (int i = 0; i < tokens.length; i++) {
    out.println("<h1>Servlet TestServlet at " + tokens[i] + "</h1>");
    out.println("----------------");
    out.println("</body>");
    out.println("</html>");
    } finally {
    out.close();
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    Needed Output :
    FILE NAME : TEST
    FILE PATH : C:\\Temp\\test.txt
    Any suggestions Plz??

    As the [HTML specification|http://www.w3.org/TR/html401/interact/forms.html] states, you should be setting the enctype to multipart/form-data to be able to upload files to the server. In the server side, you need to process the multipart/form-data binary stream by parsing the HttpServletRequest#getInputStream(). It is a lot of work to get it to work flawlessly. There are 3rd party API's around which can do that for you, such as [Apache Commons FileUpload|http://commons.apache.org/fileupload] (carefully read the User Guide how to use it).
    You can also consider to use a Filter which makes use of the FileUpload API to preprocess the request so that you can continue writing the servlet code as usual. Here is an example: [http://balusc.blogspot.com/2007/11/multipartfilter.html].

  • Error when requesting JSP page

    We have just finished getting our environment set up. We are running
    WebLogic 4.5.1 sp7 on a Sun server, and are frontending it with IIS 4.0
    SP6a using the iisproxy.dll WebLogic plugin.
    We can get things working for a while, but eventually, we get the
    following error in the NT event log when requesting the first JSP on our
    site:
    "Out of process application '/LM/W3SVC/1/Root' terminated unexpectedly"
    The Web server is still up, it's just when the JSP page is called that
    we get "Page can not be displayed" errors. Any HTML pages come up just
    fine. To fix the problem, we just stop and restart the Web Publishing
    service.
    Has anyone seen this error or does anyone know what events cause this
    problem?
    Thanks,
    -Mike

    There is a big difference between this;
    http://www.mydomain.com/blabla
    and this;
    http://www.mydomain.com/blah.jsp
    blabla - this is the name of the Web application. When you reference this Web application name Tomcat will check the welcom file descriptor and redirect for that web application.
    blah.jsp - is the name of a JSP page. When you reference this page the way you did above, you are not stating where the JSP page is located. It would be locatied in the "http://www.mydomain.com/blabla/blah.jsp" location.

  • Struts tag for request.setAttribute() in a jsp page

    Hello All
    Does anyone know struts tag that can be used for request.setAttribute() in a jsp page?
    Thanx in advance.

    Well
    <bean:define id="foo" name="newsIdAttribute" scope="request" type="java.lang.String" />is equivalent to
    <%
    (java.lang.String) foo = (java.lang.String)request.getAttribute("newsIdAttribute");
    %for setting bean properties you might have to use
    <jsp:setProperty/> or <c:set/> tags in JSP / JSTL respectively.
    Hope this might answer your question :)
    REGARDS,
    RaHuL

  • Define a request attribute for a JSP Page

    Where do I need to define the request parameters
    that will be read by my JSP Page?
    If I have a JSP:
    <% String userName = request.getParameter("name") %>Where shud the attribute name be defined so that its value is read
    by the JSP Page?
    Does it need to be defined in the tag lib as an attribute?

    Where do I need to define the request parameters
    that will be read by my JSP Page?It can be a HTML form field in another JSP from which the request comes to this JSP. Alternatively, it can be a parameter passed through the URL like
    http://myhost/myapp/myjsp.jsp?name=Richard

  • Second request to a JSP page

    When a second request is made to the JSP page, is the request sent to the servlet directly or is it handled by the JSP page. The question comes bcos when the JSP page is requested for a second time, a copy of the .class file is already available in the servlet container.

    hello,
    Even the first "request" is handled by the generated servlet! On to point, The JSP page GETS COMPILED ONLY ONCE after you install/modify it ,or on restart of server.Once a request is send to the jsp page ,the server checks for the time flag of the JSP file,and if it finds that the jsp page is modified,it recompiles the page,and send the request to the generated servlet for processing.Else it handles over the request to new servlet instance of precompiled servlet class.Note the diff in latency when you first call the JSP page and subsequent calls.This is because of foresaid reason.
    Just 4 fun try deleting the .class files in works folder,if u work on a tomcat.
    cheers
    [email protected]

  • Request dispatcher and jsp pages called from servlets

              Given the following webapp directory structure:
              root/
              jsp/
              ..all jsp files
              web-inf/
              classes/
              /servlets
                   ..all servlet files
              /com
              ..all other java class files
              I have the jsp directory coded as: jspdir = "/jsp/" (and have tried variations
              on this theme)
              I try to open a new jsp page with the following code in a servlet in the above
              servlet directory:
                   RequestDispatcher rd;
                   rd = getServletContext().getRequestDispatcher(jspdir + myjsp.jsp);
                   rd.forward(req, res);
              rd continues to return null.
              The jsp pages are not registered in the web.xml file for this webapp, if that
              makes any difference.
              Does anyone have any suggestions?     
              [problem.txt]
              

    I create a small sample and put these files into /jsp in my war context
              it works fine, please send me the example code you are using and the
              environment description of the deployed application
              I attached my samples, that work
              Filip
              ~
              Namaste - I bow to the divine in you
              ~
              Filip Hanik
              Software Architect
              [email protected]
              www.filip.net
              "Bill Blackmon" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Yes, I am able to access the jsp pages with the url listed.
              >
              > "Filip Hanik" <[email protected]> wrote:
              > >The weblogic servlet engine, is by default mapping anything that ends
              with
              > >*.jsp to be a JSP.
              > >so there shouldn't be a problem. You didn't answer my first question,
              > >are you able to access your JSP through the browser?
              > >http://localhost:7001/root/jsp/myjsp.jsp
              > >
              > >Filip
              > >
              > >--
              > >~
              > >Namaste - I bow to the divine in you
              > >~
              > >Filip Hanik
              > >Software Architect
              > >[email protected]
              > >www.filip.net
              > >"Bill Blackmon" <[email protected]> wrote in message
              > >news:[email protected]...
              > >>
              > >> The code you are reading in the message here was pasted in and
              > >> looks bad, so maybe that's what you are referring to? The dispatcher
              code
              > >is called
              > >> in the service() method of the servlet.
              > >> I have a suspicion that the jsp directory needs to be defined someplace
              > >-
              > >weblogic.properties
              > >> or web.xml?, though I don't see this in any of the examples that come
              > >with
              > >the product.
              > >>
              > >>
              > >>
              > >> "Simon Ng" <[email protected]> wrote:
              > >> >
              > >> >Hello Bill,
              > >> > Did you put a <BR>
              > >> >return;
              > >> ><BR>
              > >> >statement right after the dispatcher.forward() statement? Well, I am
              > >assuming
              > >> >your
              > >> >code is in the doPost() or doGet() methods.
              > >> >
              > >> >Simon
              > >> >
              > >> >
              > >> >"Filip Hanik" <[email protected]> wrote:
              > >> >>if you do http://localhost:7001/root/jsp/myjsp.jsp
              > >> >>
              > >> >>do you get a result?
              > >> >>
              > >> >>make sure you have the right character case on the filename.
              > >> >>
              > >> >>Filip
              > >> >>
              > >> >>--
              > >> >>~
              > >> >>Namaste - I bow to the divine in you
              > >> >>~
              > >> >>Filip Hanik
              > >> >>Software Architect
              > >> >>[email protected]
              > >> >>www.filip.net
              > >> >>"Bill Blackmon" <[email protected]> wrote in message
              > >> >>news:[email protected]...
              > >> >>>
              > >> >>> Given the following webapp directory structure:
              > >> >>> root/
              > >> >>> jsp/
              > >> >>> ..all jsp files
              > >> >>> web-inf/
              > >> >>> classes/
              > >> >>> /servlets
              > >> >>> ..all servlet files
              > >> >>> /com
              > >> >>> ..all other java class files
              > >> >>>
              > >> >>>
              > >> >>> I have the jsp directory coded as: jspdir = "/jsp/" (and have tried
              > >> >>variations
              > >> >>> on this theme)
              > >> >>> I try to open a new jsp page with the following code in a servlet
              > >in
              > >> >the
              > >> >>above
              > >> >>> servlet directory:
              > >> >>> RequestDispatcher rd;
              > >> >>> rd = getServletContext().getRequestDispatcher(jspdir + myjsp.jsp);
              > >> >>> rd.forward(req, res);
              > >> >>>
              > >> >>> rd continues to return null.
              > >> >>>
              > >> >>> The jsp pages are not registered in the web.xml file for this
              webapp,
              > >> >>if
              > >> >>that
              > >> >>> makes any difference.
              > >> >>>
              > >> >>> Does anyone have any suggestions?
              > >> >>>
              > >> >>
              > >> >>
              > >> >
              > >>
              > >
              > >
              >
              [filipInclude.jsp]
              [filipForward.jsp]
              [filip.jsp]
              

  • How to use single JSP page for multiple users.

    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.

    SuneelGoodatJava wrote:
    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.HTTP is a request/response protocol. You can't do what you're suggesting without "pushing" what you type to all the other users. That's not the way HTTP works. Maybe an applet and servlet.
    %

  • Error while running a jsp page : "jasper run time error"

    hii
    I'm facing trouble while running some jsp page . the error is as follows:
    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: Unable to compile class for JSP
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         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:802)
    root cause
    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK
         org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
         org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
         org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         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:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
    Apache Tomcat/5.0.28
    The set up in my system (path set up is as follows):
    Catalina home: C:\ apache software foundation\Tomcat 5.0
    Classpath: %java_home%;C:\j2sdk1.4.2_03\bin;
    Javahome: C:\ j2sdk1.4.2_03\jre;
    path: C:\ j2sdk1.4.2_03\bin
    <there are other variables available in path, along with that I have added the j2sdk1.4.2_03\bin in path".
    So if u have any way out for it please let me know.

    I think you only need to add: c:\j2sdk1.4.2_01
    you have specified jre on the end of your path, it is not the jre that is required, but the jdk.
    If you are using startup.bat and shutdown.bat (or .sh on Linux) you can amend the files with a text editor (open the startup.bat in notepad), like so:
    @echo off
    set JAVA_HOME=c:\j2sdk1.4.2_01
    if "%OS%" == "Windows_NT" setlocal
    I this will start Tomcat with the correct settings, regardless of your environment settings.

Maybe you are looking for

  • IPod touch library to new MacBook Pro

    Previous computer was stolen so I do not have access to it. My iPod touch has over 1,000 songs, only some of which were purchased on iTunes. Does anyone know how I can get my ENTIRE iPod touch library into my new MacBook Pro iTunes library? Thanks fo

  • Error : RFC_ERROR_SYSTEM_FAILURE: ???????? ACC_DOCUMENT ??? IDOC

    I have some problem when i want to do interface posting... This error come out when 3rd parties to connect with SAP using ALE. Can someone help me..... The error is below; com.wm.app.b2b.server.ServiceException: com.sap.mw.jco.JCO$Exception: (104) RF

  • High resolution Cinemagraph

    Hi! I am trying to create some high resolution cinemagraphs (aka gif) but seem to be having some output issues due to high rate of loss and compression. Does anyone have any recommendations in using a different software (I'm using PS CC) ? PS CC vs.

  • Delete duplicate based on conditions

    Hi, <div style="border: 1pt solid windowtext; padding: 1pt 4pt"> {size:9pt}SQL> select * from v$version;{size} {size:9pt} BANNER ----------------------------------------------------------------{size} {size:9pt}Oracle Database 10g Express Edition Rele

  • Error with Hardware Diagnostic Suite 3.6.1

    Hi When I try and run hardware diagnostici suite on an agent I get the error mesage: "Please make sure the Hardware Diagnostic Suite server is running on the Sun Management Center server machine." I don't know how to do this despite a trawl through a