Problem in forwarding to a jsp page

Hi everyBody,
I m forwarding a jsp to another jsp page and i m using
" <jsp:forward page = "searchForm.jsp"/>"
it printing statement that i have written jst before that.
but when it comes to that statement it is giving
"Servlet Exception :Cannot forward after response has been committed "
why so?
can any one help me?
i m also using struts.
thanks in advance
shobhit

Hi snma,
This is probably happening because you commited the response twice. Maybe you�ve used the ActionForward object, to forward the response and after forward it, you�ve tried to re-forward using the jsp tag.
the HttpServletResponse has a isCommited() method that can check if the response was commited .

Similar Messages

  • Problem in displaying image on jsp page

    I want to display an image on jsp page.I copied the image the image in WebContent folder.
    I am able to see the image on the design pane when using the following code:-
    <img src="/image.gif" height="50" width="50"> but when i run it in the browser nothing gets diplsyed.
    also when i use the image container and select the source option that image is not displayed in the WebContents file..plz help.

    Hi,
    Seems that the Problem is there with the way how you specifuied the Image relative Path:
    You have specified the below: The opath of image starts with (/) forward slash:
    *<img src="/image.gif" height="50" width="50">*
    It means to access this Image WebLogic Container will form a Path like this:
    http://localhost:7001/image.gif
    BUT may be the image is available inside your Context root: So Change the <Img> tag like following in your JSP:
    *<img src="image.gif" height="50" width="50">*
    (*NOTE:* Never Start your src path with a Preceesing /)
    Now WLE will consider the path like below ..if your Applications Context root is "TestApp"
    http://localhost:7001/TestApp/image.gif
    I am Assuming that Inside the TestApp Application "image.gif" And "your.jsp" jSP pages are Co-Located (Means available in the Same Directory).
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Magical Stuff)

  • Problem connecting oracle database to jsp pages using Apache Tomcat server 8.0

    Well...I tried too many things..googled so many times..but still could not find solution to my problem.
    I use windows 8 Enterprise Edition(if this has to do something with the problem)
    Oracle 11.2.0
    Apache Tomcat server 8.0
    JDK 1.7
    My oracle is installed in the D: drive and tomcat in c:. i copied the ojdbc6.jar file from oracle to lib directory of tomcat server.
    Then i set  CLASSPATH in environment variables as "C:\Program Files\Apache Software Foundation\Tomcat 8.0\lib\ojdbc6.jar" in system variables
    My path variable is set as "C:\Program Files\Java\jdk1.7.0_02\bin".
    My program is as follows in notepad:
    <%@ page import="java.sql.*" %>
    <html>
    <body>
    <%
    Connection conn;
    Statement st;
    ResultSet rs;
    try{
    new oracle.jdbc.driver.OracleDriver();
    String dbURL="jdbc:odbc:oracle:thin:@localhost:1521:XE";
    String userId="system";
    String pwd="moon";
    conn=DriverManager.getConnection(dbURL,userId,pwd);
    st=conn.createStatement();
    rs= st.executeQuery("SELECT * FROM login");
    while(rs.next())
    System.out.println(rs.getString(1)+""+rs.getString(2));
    catch(Exception e){}
    %>
    </body>
    </html>
    I get too many errors then
    eroors
    org.apache.jasper.JasperException: An exception occurred processing JSP page /page2.jsp at line 14
    11: String userId="system";
    12: String pwd="moon";
    13:
    14: conn=DriverManager.getConnection(dbURL,userId,pwd);
    15: st=conn.createStatement();
    16:
    17: rs= st.executeQuery("SELECT * FROM login");
    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    root cause
    javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:905)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:834)
         org.apache.jsp.page2_jsp._jspService(page2_jsp.java:102)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
         org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    Nothing solved this problem.

    >> Nothing solved this problem.
    Can't fix a problem 'till an actual problem is identified.
    >> ODBC Driver Manager ... Data source name not found
    That appears to be ODBC drivers looking for a DSN (Data Set Name). If it wants a DSN, the DSN has to be specified in the code, and the DSN has to be configured in the windows host ODBC applet. So that is at least two squirrels to get in the right tree before moving forward. A ...host:...[port:]SID|service name are some of the bits needed in a jdbc connect string, and that is in no way related to DSNs. A Whole Different Animal. If it wants a DSN that might be what needs to go in the URL bit.
    And ODBC setups can be confusing, especially if an x64 OS is in the mix- if that is the case there are two different ODBC configuration applets, one for x64 the other for x86, and if one gets as far as talking to an actual database it might toss an architecture error. Only way to fix that "problem" is *delete* the ODBC DSN and then run the correct (maybe the x86) ODBC config utility, and set up the DSN. Again.

  • Problem in forwarding to a JSP file

    Here is my code. I'm not able to forward to another jsp when I click on the modify button. If I display anything using alert inside the modify function, it is displaying. But when I include the forward statement, the entire screen becomes blank. What could be the reason.
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.util.*,com.gh.db.*" errorPage="Error.jsp" %>
    <html>
    <head>
    <TITLE>Guest Houses of DOS</TITLE>
    </head>
    <%@ include file="StdValidations.js" %>
    <script Language="text/JavaScript">
    function ClearFields()
         document.UserAdmin.Ln.value = "";
         document.UserAdmin.Nm.value = "";
         document.UserAdmin.SecNm.value = "";
         document.UserAdmin.submit1.disabled=false;
         document.UserAdmin.submit2.disabled=false;
         document.UserAdmin.submit3.disabled=false;
         document.UserAdmin.submit4.disabled=true;
         document.UserAdmin.option1.value="";
         document.UserAdmin.option3.value="";
         document.UserAdmin.option2.value="";
    function EnterTo()
              document.UserAdmin.option1.value ="Add";
              document.UserAdmin.submit1.disabled=true;
              document.UserAdmin.submit2.disabled=true;
              document.UserAdmin.submit3.disabled=true;
              document.UserAdmin.submit4.disabled=false;
              document.UserAdmin.submit;
    function Save()
         alert(document.UserAdmin.option1.value);
         if ((document.UserAdmin.option1.value == "Add"))
    if ((document.UserAdmin.Ln.value != "") &&(document.UserAdmin.Nm.value != "") && (document.UserAdmin.SecNm.value != ""))
         document.UserAdmin.option3.value = "Save";
         return true;
    else
         alert("Input ALL Values");
         return false;
    function valid(form)
         if (document.UserAdmin.option3.value == "")
              this.disabled=true;
              return false;
    function Modify()
         <jsp:forward page="ModifyUser.jsp" />
    </script>
    <body>
    <form name="UserAdmin" method="post" action="UserAdmin.jsp" onSubmit="return valid(this);">
    <br><br><br>
    <center>
    <%
         String choice1="",choice3="";
         String Ln="",Nm="",SecNm="",Rl="";
         DBconnection pool = DBconnection.getInstance();
         Connection con = pool.getConnection();
         con.setAutoCommit(false);
         Statement st1 = con.createStatement();
         int NoofRows;
         choice1 = request.getParameter("option1");
         if (choice1 == null) choice1 = "";
         choice3 = request.getParameter("option3");
         if (choice3 == null) choice3 = "";
         if ((choice1.equals("Add")) && (choice3.equals("Save")))
         %>
              <script> alert("done");</script>
         <%
         Ln = request.getParameter("Ln");
         if (Ln == null) Ln = "";
         Nm = request.getParameter("Nm");
         if (Nm == null) Nm = "";
         SecNm = request.getParameter("SecNm");
         if (SecNm == null) SecNm = "";
         try
         st1.executeUpdate("insert into TableUser (LoginName,Name,SectionName,Password) values ('" + Ln + "', '" + Nm + "','" + SecNm + "','" + Ln + "')");
              choice1="";
              choice3="";
              con.commit();
         catch(Exception e)
         e.printStackTrace();
         %>
         <script> alert("Record Already Exists : <%= e %>"); </script>
         <%
         %>
         <script> ClearFields(); </script>
         <%
    %>
    <%      
         String LoginName= "";
         String Name= "";
         String SectionName= "";
         try
              LoginName = session.getAttribute("LoginName").toString();
              Name = session.getAttribute("Name").toString();
              SectionName = session.getAttribute("SectionName").toString();     
         catch(NullPointerException npe)
              %>
              <jsp:forward page="LoginHere.jsp" >
              <jsp:param name="SessionMode" value="Session Expired try again to log on" />
              </jsp:forward>
              <%
    %>
         <table width="80%" bgcolor="#F6F8C4">
              <tr >
              <td align="center">
                   <img src="Images/Title.gif">
                   <img src="Images/gh1.jpg" ></br>
              </td>
              </tr>
              </tr>
                        <tr>
                        <td>
                        </td>
                        <td align="right">
                             <font face="Times New Roman, Times, serif" size="+1">Logout</font>
                        </td>
              </tr>
         </table>
         <table width="80%" bgcolor="#B6C7E5">
         <tr >
         <td align="center">
              <font face="Comic Sans MS" color="6D3C1E" size="+1">User Addition</font>
         </td>
         </tr>
         </table>
         <table width="80%" bgcolor="#B6C7E5">
              <tr >
              <td >
              <font face="Times New Roman, Times, serif" size="+1">Name:  <%= Name %></font>
              </td>
              <td align="right">
                   <font face="Times New Roman, Times, serif" size="+1">SectionName:  <%= SectionName %></font>               
              </td>
              </tr>
         </table>
              <table width="80%" bgcolor="#B6C7E5">
              <tr>
              <td align="center">
              <INPUT name="img" type="Image" value="Assign Role" src="Images/Role.jpg">
              </td>
              <td>
              <table width="80%" bgcolor="#B6C7E5">
                   <tr>
                   <td width="60%" align="right">
                   <P >     Login Name :     <INPUT id=text1 name=Ln> </P >
                   <P >     User Name :     <INPUT id=text2 name=Nm> </P>
                   <P >     Section Name :    <INPUT id=text3 name=SecNm> </P>
                   <p>
                   <INPUT name="submit2" type="button" value="Modify" onclick="Modify();">
                   <INPUT name="submit1" type="button" value="Add" onclick="EnterTo();">                                                  
                   <INPUT name="submit3" type="button" value="Delete" onclick="Delete();"></p>
                   </td>
                   <td align="left">
                   <INPUT name="submit4" class="Button" type="submit" value="Save" disabled="true" onclick="Save();" ></br></br>
                   <INPUT name="reset1" type="reset" value="Clear" onClick="ClearFields()" > </br>
                   </td>
                   </tr>
                   </table>
              </td>
              </tr>
              </table>
              <table width="80%" bgcolor="#B6C7E5">
              <tr>
              <td align="center">
                   </br>
                   <img src="Images/Home.jpg">
              </td>
              </tr>
              </table>     
              <input type=hidden name= "option1"> <br>
              <input type=hidden name= "option3"> <br>
              <input type=hidden name= "option2"> <br>
              <% if (st1 != null) st1.close();
                   if (con != null)
                        con.rollback();
                        con.setAutoCommit(true);
                        pool.returnConnection(con);
              }     %>
    </table>
    </center>
    <input name="HomePage" type="hidden">
    </form>
    </body>
    </html>

    Hi snma,
    This is probably happening because you commited the response twice. Maybe you�ve used the ActionForward object, to forward the response and after forward it, you�ve tried to re-forward using the jsp tag.
    the HttpServletResponse has a isCommited() method that can check if the response was commited .

  • Problem with bean in a JSP page

    I have developped a JSP pages in wich I call a bean with
    <jsp:useBean id="db" scope="request" class="SQLBean.class" />
    The bean SQLBean.class is in the same directory as the JSP page.
    When I execute the JSP, I have the following error:
    SQLBean.class db = (SQLBean.class) JSPRuntime.instantiateBean("db", "SQLBean.class", "request", __db_was_created, pageContext, request, session, application);
    Syntax error: [expected after this token
    Syntax error: "]" inserted to complete ArrayAccess
    Syntax error: "AssignmentOperator AssignmentExpression" inserted to complete StatementExpression
    I use JRUN with IIS
    Thanks for the help

    I am assuming your class name is SQLBean.
    use:
    <jsp:useBean id="db" scope="request" class="SQLBean" />
    instead of:
    <jsp:useBean id="db" scope="request" class="SQLBean.class" />

  • SSO problem when redirecting from a JSP page to an external application

    Hi,
    I try to make a redirect from a JSP page (that is under a SSO protected application on iAS) to another page from another application, on an external iAS server, also protected by (a different) SSO. After the redirection is done, the login window appears, I enter the login name and the password and after that I obtain the followin error:
    "Oracle SSO Failure - Unable to process request
    Either the requested URL was not specified in terms of a fully-qualified host name or OHS single sign-on is incorrectly configured.
    Please notify your administrator."
    In the logs og the server I found the following:
    [OSSO] W05: Requested URL is not specified in terms of fully-qualified host name or invalid SSO partner configuration. Host from request
    mycompany.com:7777, registered host 144.147.147.200:7778.
    (the ip address being the address of the mycompany.com host).
    Any clue about this? Thanks a lot in advance!
    Regards,
    Marinel

    Hi Carlo,
    Thanks for your answer.
    The JSP original page is not added as a partner application to the second SSO server.
    The idea was that the user should insert first the login name/passwd for the first server, after being logged in, then redirected to the second application (on a different server), insert the login name/password for the second application and then load the 2nd application page. It seems that is not working after inserting the password for the 2nd application.
    Coming to a more general question that could help me to avoid this complicated approach: is it possible to have two different applications deployed on two different iAS servers and the two applications to use the same SSO (let's say the one from the first iAS server)? I have to mention that the process scenario is the following: the user load a page from the first application (protected by SSO), then, after successfull login and some processing in the first app, he will be automatically redirected by the first app to the second application, on the second server. I want to have also the second application, on the 2nd server, protected by SSO (ideally would be the same SSO as the first one!). Ideally the scenario would be: if it is redirected from the first app and the user is already authenticated, the automatic redirection should be done transparently for the user (without enetring the password again). If the user goes directly from the browser to a page of the second app, the SSO login window should be displayed and the user should provide his password.
    Is such a scenario possible on two apps deployed on two different servers?!
    Thanks a lot again!
    Regards,
    Marinel

  • Problem with forward method of jsp

    am having problem with the requestDispatcher.forward method in my jsp + wml , the forward method gets executed but the new page is not displayed in the wap browser,
    code snippet
    small.jsp
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <%@ page language="java" %>
    <%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
    <%@ page import="java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util.Properties "%>
    <%
    System.out.println("in small");
    RequestDispatcher rd = request.getRequestDispatcher("small1.jsp");
    rd.forward(request,response);
    %>
    small1.jsp
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <%@ page language="java" autoFlush="false"%>
    <%@ page contentType="text/vnd.wap.wml; charset=UTF-8" %>
    <%@ page import="java.net.*,java.lang.*,java.io.*,java.util.*,java.util.Vector,java.util .Properties"%>
    <%
    String sm = "small1";
    System.out.println("in small1");
    %>
    <wml>
    <card id="two">
    <p>
    <small><%=sm%></small>
    </p>
    </card>
    </wml>
    i get the following output in the log
    in small
    in small1
    but i dont get to see the small1.jsp' content , also the response.sendRedirect method works fine ,,
    pls give me the soln
    Thnk u in advance

    thank u very for the repl this is the message which i get in the nokia wap browser...
    cannot load small1.jsp(HTTP Error 500 Server Error)
    and i use IBM WebSphere as the web server....
    and i have found that using response.reset in the small2.jsp overcomes this problem but the card title and the anchor tag is not displayed !!!!
    what could be this problem?

  • Error in forwarding to other jsp page

    HI ,
    I am trying to move from one page to other page by using jsp:forward.
    I get the following error. what might be the problem.
    java.lang.NullPointerException at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:688) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:658) at org.apache.jsp.jsp.listing.controller_jsp._jspService(controller_jsp.java:329) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.businessobjects.webutil.encoding.EncodingFilter.doFilter(EncodingFilter.java:24) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)

    >
    HI ,
    I am trying to move from one page to other page by using jsp:forward. That sounds like a really bad idea, or possibly a misunderstanding of what forwarding means.
    I get the following error. what might be the problem.
    That the path you are giving to the forward entity is not valid. Forward depends on the target URI being within the same web application and the URI should be a simple path.

  • Problem on sending sms in jsp page

    hi to all,
    i am using smslib for sending sms from pc to mobile.it work fine in all java file but when i implement in jsp file it gane me error of serial port that"port does not exist".how can i solve this problem...
    Edited by: kinjal on May 30, 2008 9:36 AM

    hi,
    this was sort of an urgent requirement, i was using J2SE, no way to compile servlets,
    when i compile sample code in SE, it gave me 6 errors
    C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\star\WEB-INF\clas
    ses\com\stardeveloper\servlets>javac -cp %CATALINA_HOME%\lib\servlet-api.jar Tes
    tServlet.java
    TestServlet.java:7: package javax.servlet does not exist
    import javax.servlet.*;
    +^+
    TestServlet.java:8: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    +^+
    TestServlet.java:10: cannot find symbol
    symbol: class HttpServlet
    +public class TestServlet extends HttpServlet {+
    +^+
    TestServlet.java:12: cannot find symbol
    symbol  : class HttpServletRequest
    location: class com.stardeveloper.servlets.TestServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    +^+
    TestServlet.java:12: cannot find symbol
    symbol  : class HttpServletResponse
    location: class com.stardeveloper.servlets.TestServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    +^+
    TestServlet.java:13: cannot find symbol
    symbol  : class ServletException
    location: class com.stardeveloper.servlets.TestServlet
    +throws IOException, ServletException {+
    +^+
    +6 errors+
    at the sametime sun site was offline, so i decided to do it in JSP,
    upto upadating DB im done,
    but get stuckd at sms part,
    now ive installed the J2EE, but stil when i compile, it gives the same old errors.
    im completely new to this area of web applications, dont hav know how of the operation.
    what i want is sending SMS using SMPP on button click in web page.
    pls pls help me get rid of this, either using servlets or JSP
    thanking u.....

  • I have a problem when a generate a jsp page

    I hope some one can help me i generate a application module with jdeveloper release 3.1 So when i try to run my application module with jsp i found the next error..
    I don't know why..
    Error Message: JBO-25222: Unable to create application module.
    Error Message: JBO-25002: Definition webjsp1.Webjsp1Module of type
    ApplicationModule not found

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Juan Oropeza ([email protected]):
    Make sure you build you middle tier project prior to running the jsp client.<HR></BLOCKQUOTE>
    Hablas espaqol???
    Lo que pasa es que no me quedo muy claro lo de construir un middle tier project prior para correr el cliente JSP, me puedes orientar por favor. De hecho al correr un Applet desde codigo HTML, me saca el mismo error :
    DAC-405: SessionInfo: Application module creation failed; className: MioModule
    JBO-25222 unable to create application module. null
    Nuevamente te agradezco, tu tiempo
    null

  • Forward to JSP page without using Navigation Model

    How can I forward to a JSP page without using the Navigation Model?

    It's done in the cardemo example in
    ImageMapEventHandler.processAction() Is there a reason
    for it there?Ah ... that makes sense.
    That code in CarDemo was written before there was such a thing as a NavigationHandler, and we didn't have time to update it to the new approach before the EA4 release. That'll be changed before the next one. In the mean time, I'd recommend that you use the navigation rules mechanism where it works for you, because it encourages good separation of business logic and presentation logic that will lead to more maintainable applications.
    Craig

  • How to forward a jsp page in flex application ( when a button is clicked)

    i am a fresher to this FLEX 2.0 , i designed the UI part in
    flex, but when i click the submit button it has to forward to the
    JSP page to check against the valid user,password , so how to
    forward the page to jsp(i mean from flex to jsp) , if u can suggest
    me with an example, it will be easy for me, is Flex Data Service 2
    is necessary for this
    thanks for ur speedy reply, hopping to get the solution for
    this issue,
    sandeep

    Your JSP is, as far as Flex is concerned, just a data service
    which it will request and read its response. I'd suggest using
    <mx:HTTPService>. For example:
    <mx:HTTPService id="authorize" url="validate.jsp"
    fault="handleFault(event)" result="handleResult(event)">
    <mx:request>
    <userid>{username.text}</userid>
    <password>{password.text}</password>
    </mx:request>
    </mx:HTTPService>
    Flex creates the request:
    http://{server}.{port}{context.root}/validate.jsp?userid=fred&password=flintstone
    assuming that you have <mx:TextInput id="username" />
    and <mx:TextInput id="password" /> components.
    Your Submit button then does: authorize.send()
    (note: you can also pass the request parameters in the send()
    method - check the Flex docs on HTTPService).
    Flex will listen for the response from your JSP. Typically a
    JSP would respond with an HTML page, but you don't want to do that
    for Flex. Your JSP should produce either a simple string ("yes" or
    "no" or "error" etc) or an XML document.
    The handleResult method can examine the response and do
    what's necessary.

  • JSP on BEA  Weblogic: random error when loading a jsp page that uses a Bean

    Hi!
    I wrote a simple jsp page that stores a String in a JavaBean, and then forwards to another jsp page to display that String. The jsp pages are deployed on a BEA Weblogic 6 Server, but I get a weird behaviour when loading the page into my browser. Usually I get an error message:
    /Response.jsp(9): class 'query.jsp.QueryBean' could not be loaded
    probably occurred due to an error in /Query.jsp line 9:
    <jsp:useBean id = "queryBean" scope = "request" class = "query.jsp.QueryBean" />
    But the funny thing is that after reloading the page a few times it eventually works. The bahaviour seems to be totally random - sometimes it works, sometimes it claims not finding the JavaBean class.
    Anyone experienced something similar?
    Thank you very much,
    Charlie

    Is QueryBean.class located under '<appname>/Web_inf/query/jsp/'?
    If it is please try changing the package name to something else like com.myclass or something like that.

  • How can I Locate the correct filepath in a jsp page?

    In http://localhost:8080/myweb/a.jsp, I will call a java bean file which is locate in http://localhost:8080/myweb/WEB-INF/classes/haha/DBConnection.class. This java file requires to read an external file which locates in http://localhost:8080/myweb/WEB-INF/classes/haha/db.txt
    My question is how can I get the correct filepath in this environment?
    inputStream = new BufferedReader(new FileReader(????????));
    Only this will work
    inputStream = new BufferedReader(new FileReader("D:\Program Files\Apache Software Foundation\Tomcat 5.5\db.txt"));
    But no one will place the file here, and it is impossible to do this when upload to 3rd party hosting.
    Any suggestion? thx.

    Thx all, in a jsp page, calling this method is fine.
    ServletContext s = getServletContext();
    String a = s.getRealPath("/");
    In a Servlet file, below method is ready to use:
    String b = getServletConfig().getServletContext().getRealPath("/");
    My problem is, I have a jsp page, which initialize a java bean , this java file is responsible for Database Connection, which will read the external text file to get the login, password and database name. So I won't need to recompile this file every time when I place in different platform with different configuration. I only need to edit the text file is ok.
    But How can I get the absolute file path when that jsp page initialize that java bean file? Below is my error, any suggestions are thx.
    package sql;
    import java.sql.*;
    import java.util.ArrayList;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DBConnection extends HttpServlet{
    public String sql = null;
    public Connection con = null;
    public Statement statement = null;
    public ResultSet rs = null;
    private BufferedReader inputStream = null;
    private static ArrayList<String> arr = new ArrayList<String>();
      public DBConnection(){
        String fs = System.getProperty("file.separator");
        ServletContext s = getServletContext();
        String realpath = s.getRealPath("/");
        String filepath = realpath + "WEB-INF"+fs+"Properties"+fs+"db.txt";
        try{
          inputStream = new BufferedReader(new FileReader(filepath));
          String l;
          while ((l = inputStream.readLine()) != null) {
            arr.add(l);
          Class.forName("com.mysql.jdbc.Driver");
          this.con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+arr.get(0)+"?user=" +arr.get(1)+ "&password="+arr.get(2)+"&useUnicode=true&characterEncoding=utf-8");
          this.statement = this.con.createStatement();
        }catch (Exception e){
          System.err.println(e.getMessage());
        }finally{
    }java.lang.NullPointerException
         javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159)
         sql.DBConnection.<init>(DBConnection.java:20)
         html.ShowCategory.<init>(ShowCategory.java:17)
         org.apache.jsp.left_jsp._jspService(left_jsp.java:66)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Maximum size of a compiled JSP page

    Has anybody else come accross a problem with weblogic not displaying .jsp pages greater than
              

              One solution could be to break the jsps in small jsps ...
              "John" <[email protected]> wrote:
              >
              >Apparently there's a resitrction in the Java spec that the size of a
              >compiled method
              >cannot exceed 64kb. I'm looking for a way to get around this now
              >
              >Adam Willis <[email protected]> wrote:
              >>Has anybody else come accross a problem with weblogic not displaying
              >>.jsp pages greater than
              >
              

Maybe you are looking for

  • Connect problem with db link and scheduler_jobs on 10.2.0.4.0

    hello guys i have got this problem, i hope someone can help me to understand and solve it. I have a pl/sql procedure where is referenced a table on a db_link. I own all the grants needed, and if i recall it in an anonymous block, it seems to work. i.

  • Need to open files made in Mainstage 2 in the older version of Mainstage.

    Any suggestions? I'm working with a collaborator on a project and I have Mainstage 2, while he's still on the original Mainstage. We need a way to open the files I make on his computer, but I no longer have my installation CDs. Is there a way to conv

  • BI System in separate client in ERP system

    Hello Since we build small testing landscape with ERP 6.0 IDES I was looking for the solution how to add BI system in existing landscape Two solutions are possible: 1 install BI on separate hardware - HERE I need to buy additional hardware 2 install

  • Getting the operating unit info in 11i front end

    Hi All, I'm having a doubt about getting the operating unit info from the front end (i.e) for the given form how can we find which OU is attached to it(For ex. PO form).I dont know the navigation to get the value of the OU from the profile options in

  • Getting my 3G ready to sell

    I'm sorry if this is the wrong category for this..wasn't quite sure where to put it. I recently upgraded to an iPhone 4 from my 3G. I would like to sell my 3G but I wasn't quite sure what exactly I needed to do to get it ready to sell. I am with AT&T