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?

Similar Messages

  • Problem with the method in JSP

    <%@ method = "doPost" %> ******* if i remove this statement i am getting output but what is wrong with this statement ********
    <HTML>
    <HEAD><TITLE>Hello</TITLE></HEAD>
    <BODY>
    <H1>
    <% if (request.getParameter("name") == null) { %>
    Hello World
    <% } else { %>
    Hello, <%= request.getParameter("name") %>
    <% } %>
    </H1>
    </BODY></HTML>
    (thank you for the last posted problem solving)

    There is no <%@ method %> tag for a JSP.
    http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    It looks like you are trying to write a JSP that only accepts post requests - not get?
    I'm not sure if you can accomplish that in a JSP directly.
    You can with an HttpServlet (which is where the doGet/doPost methods are defined) but HttpJspPage doesn't extend that class necessarily.
    Best you could probably do is put in a test of request.getMethod() to see if it is get/post.

  • Problems using GET method in JSP

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET method in JSP?
    If anyone have solutions, please let me know.
    thanks.

    Hi,
    I had some problems using GET method in JSP.
    I'm using Apache web server 1.3 and Tomcat 3.3.1 in
    windows 2000.
    And I'm using language English and Korean.
    When I send messages using POST method, all is good
    But when I send message using GET method, English is
    good, but Korean is not good.
    I tried to encode using
    URLEncode.encode(str, "UTF-8")
    and decoding it using
    URLDecode.decode(request.getParameter(tag), "UTF-8")
    but it didn't work.
    How can I receive request including Korean using GET
    method in JSP?
    If anyone have solutions, please let me know.
    thanks.This problem appears, when one use UTF-16 encoding in JSP - am I right?
    If so there are two solutions:
    1) Temporary: Use "UTF-8" - or any other 8 bit encoding scheme and
    encode Korean symbols with "&1234;" kind of escapes - though it
    may not work
    2) Absolute: get my piece of code, which I have managed to write
    just a month ago resolving absolutely similar problem with UTF-16
    in code using Chinese/Russian/English encodings
    But I wouldn't say that it's costs 10 DDs :) - it's much more
    expensive... So try 1st variant if it wouldn't help - let me know.
    I'll figure :)
    Paul

  • I have problem with pay method

    I have problem with pay method. My card declined. I change card and I have the same problem. What can i do? Why declined my card again?

    Contact iTunes store support: https://ssl.apple.com/emea/support/itunes/contact.html.

  • Problem with traverse method

    Hi, I am having this problem:
    I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
    The problem is that when I press the left or rigth button it also returns false and not true.
    and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
    protected void paint(Graphics g, int ancho, int alto) {
              System.out.println ("Dentro del paint, seleccionado="+seleccionado);
              try {
                   g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
                   if (!seleccionado) {
                        g.setColor(120, 120, 120);
                   g.drawRect(0, 4, tama�oTexto+8, 25);
                   if (seleccionado) {
                        g.setColor(255, 255, 255);
                        g.fillRect(1, 5, (tama�oTexto+8-1), 23);
                   g.setColor(0, 0, 0);
                   if (!seleccionado) {
                        g.setColor(80, 80, 80);
                   g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
                   if (seleccionado) {
                        int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
                        g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
              } catch (Exception E){
                   E.printStackTrace();
         }the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).

    I have a problem with findByxxx() method.. in
    Container managed bean.
    i have
    Collection collection =
    home.findByOwnerName("fieldValue");
    specified in my Client Program, where ownerName is the
    cmp fieldname..
    and
    public Collection findByOwnerName(String ownerName)
    throws RemoteException, FinderException
    defined in my home interface.
    i have not mentioned the findBy() method anywhere else
    (Bean class). You have to describe the query in the deployment descriptor.
    >
    Even if i have a same "fieldValue" in the database
    (Oracle), which i specified in findBy() method, iam a
    result of owner Not found, which is not the case as i
    have that owner name.
    for the same application if i use findByPrimaryKey(),
    it is working..
    Can any one please post me the solution.

  • Problem with prerender method

    Hi,
    I have a problem with the method prerender. A month ago, I started to develop a web project using Sun Studio Creator and a few page beans that i used extended the Abstract Page Bean, so I overrided the prerender and customized it.
    The problem is that, now i'm using eclipse and the configuration files of the project has changed and the prerender method never execute.
    I want to know why it is happening. Maybe the project is "bad-configurated"?
    Thanks

    The code of java bean doesn't change, the only thing that has changed is the configuration files (faces-config.xml, web.xml, etc).
    I put a breakpoint in the prerender method but the lifecycle doesn�t execute this method.
    After serveral changes, I wrote this code in the method prerender :
    int i=0;
    i = 1;
    And the prerender method doesn't execute.
    I'm a bit lost,
    thanks

  • Problem with affinetransformOp method...

    I have a serious problem with filter method
    I Want to make a image flipping or some other filtering by using
    AffineTransformOp
    but it printouts an erro like this
    cannot resolve symbol
    op.filter (img, flipped)
    (the error pointer shows ".after the op")
    a code from my one of the filters
    BufferedImage flipped = new BufferedImage(img.getHeight(), img.getWidth(),BufferedImage.TYPE_INT_RGB);
    AffineTransform trans = new AffineTransform(0, 1, 1, 0, 0, 0);
    AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    op.filter(img, flipped); //img is my buffered image source
    I used some other ways like (img, null) but always give out error.
    thanks..

    Did you declare "img" as BufferedImage or something else?
    What is the full error message?

  • Problem with WindowClosing() method

    Hello everyone,
    I have some problem with WindowClosing() method, in which I gave options
    to quit or not. Quit is working fine but in case of Cancel, its not returning to
    the frame. Can anyone help me ....Here is my code
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    public class TestFrame extends JPanel
         public static void main(String[] args)
              JFrame frame = new JFrame("Frame3");
              WindowListener l = new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        int button = JOptionPane.showConfirmDialog(null,"OK to Quit","",JOptionPane.YES_NO_OPTION, -1);
                        if(button == 0)     {
                             System.exit(0);
                                   else
                                              return;
              frame.addWindowListener(l);
              frame.setSize(1200,950);     
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }

    Maybe try
    int button = JOptionPane.showConfirmDialog(yourframe,"OK to
    Quit","",JOptionPane.YES_NO_OPTION, -1);

  • Trouble with forward() method in a Servlet

    I am new to Servlets and am having trouble with one that queries a database and forwards the data to a JSP. A portion of the code is below (The <i> are really , but are being displayed wrong).
                   for(int i = 0; i < numberOfRows; i++)
                        data2[0] = rs.getString("REIMBUR_DATE");
                        data2[i][1] = occupancyPCT;
                        data2[i][2] = rs.getString("RMBR_RATE_REVENUE");
                        data2[i][3] = rs.getString("RMBR_ROOM_TAX");
                        data2[i][4] = "reimbur total";
                        data2[i][5] = rs.getString("BOOK_RATE_REVENUE");
                        data2[i][6] = rs.getString("BOOK_ROOM_TAX");
                        data2[i][7] = "rebate";
                        data2[i][8] = "tax rebate";
                        rs.next();
                   request.setAttribute("CERT_INFO", data);
                   request.setAttribute("OTHER_INFO", data2);
                   request.setAttribute("NUMBER_ROWS", new Integer(numberOfRows));
                   ServletContext context = getServletContext();
                   RequestDispatcher dispatcher = context.getRequestDispatcher("/certdetails.jsp");
                   dispatcher.forward(request, response);
              catch(Exception ee)
                   PrintWriter out = null;
                   response.setContentType("text/html");
                   out = response.getWriter();
                   out.println("<html>");
                   out.println("<body>");
                   out.println("Exception !!<br>");
                   out.println(ee.getMessage());
                   out.println("</body>");
                   out.println("</html>");
    When I include the line with the forward() method, I get an exception and the message is "1998-08-20", the contents of data2[numberOfRows - 1][0]. I don't know why an exception is being generated or how it is getting this database value as its message. What's going on?

    Nevermind, I found the problem. There was an error in my JSP. I don't know how it affected the Servlet as it did, but...who cares!!

  • Problem with forwarding to new page in jsf

    Hi
    I am facing a problem. I have a checkbox in my jsp page and 3 submit button. The two button works w r t check box and its woking fine. I am getting problem with the 3rd button. I want to fwd to next page once the button is clicked.
    For the check box i am using the method
    public String handleCheckbox2ValueChange(ValueChangeEvent valueChangedEvent)
    Can anyone help me in this regard. I need to fwd to the next page.
    Regards
    Rupesh

    This sounds like a simple JSF navigation that has nothing to do with the checkbox. Read the documentation and tutorials on navigation.

  • Problem with forward using RequestDispatcher

    Dear All
    Below is my code, which trying to use the RequestDispatcher.forward to go from a Servlet to a .jsp page.
    and use
    getServletContext().setAttribute("SvBio",vBio);
    to set an attribute
    It compiles finely but stuck at the forward request to the jsp page and through an exception which is given below.
    BUT on removing this statement
    getServletContext().setAttribute("SvBio",vBio);
    from my doget method , it works and forwrds to the next page
    please help me identifying the problem
    Thanks
    NAV
    ////Part of CODE////////////////
    Vector vBio;
    public void init()
    // vector vBio initialize in init()
    public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
    getServletContext().setAttribute("SvBio",vBio);
    if(param1 == bio)
    gotoPage("/jsp_pages/bio_gp.jsp", request, response);
    private void gotoPage(String address, HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(address);
    if(dispatcher !=null)
    dispatcher.forward(request, response);
    ///exception//////////////////
    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
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at nav.gotoPage(nav.java:363)
         at nav.doGet(nav.java:319)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
         at java.lang.Thread.run(Thread.java:595)
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.bio_gp_jsp._jspService(bio_gp_jsp.java:59)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at nav.gotoPage(nav.java:363)
         at nav.doGet(nav.java:319)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
         at java.lang.Thread.run(Thread.java:595)
    Apache Tomcat/4.1.29-LE-jdk14

    Thanks evnafets
    I find out null pointer assignment in jsp page where forward request was heading.
    There is one more question, if you help me a better understanding the issue
    I have a HTML page invokes the servlet by passing value of parameter, Servlet do some procesing and forward to JSP page depending on the incoming parameter,
    Can JSP page invoke the same servlet by passing some other parameter?
    I tried doing this, but it returns an empty page and didnt went back to servlet.
    HTML Page ---->Servlet--------> JSP page ---------> Servlet
    I think Forward method shift the control from the Servlet to JSP page and now its the responsibility of the jsp page to deliver the response to the client.
    Am i getting the empty page on invoking the servlet from the JSP page because I have not deliver the response to the client?
    ///the code of the JSP page is as fallows///
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>NAVTITLE</title>
    </head>
    <body link="#0000FF" vlink="#0000FF" alink="#0000FF">
    <td height="340" width="977">
    <p align="center"><font size="8" color="#001000"><b>biomolecular group           page</b></font></p>
    <%@page import="java.util.Vector"%>          
    <% Vector vBiopt = (Vector)getServletContext().getAttribute("SvBio");     
    out.println("\nThe size of vBio is ::"+vBiopt.size());
    int n = vBiopt.size();
    %>
    <p>This is the dynamic page generated for the biomolecular group</p>
    <%
    for(int k=0;k<n;k++)
    String href1 ="http://localhost:8080/nav/nav2?param2=";
    String item = (String)vBiopt.elementAt(k);
    out.println("<p><a href= \"" + href1 + k + "\">" + item + "</a></p>");
    %>
    </body>
    </html>

  • Problem with java beans and jsp on web logic 6.0 sp1

              HI ,
              I am using weblogic6.0 sp1.
              i have problem with jsp and java beans.
              i am using very simple java bean which stores name and email
              from a html form.
              but i am getting following errors:
              Full compiler error(s):
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              "userbn"); //[ /SaveName2.jsp; Line: 7]
              ^
              3 errors
              in which directory should i place java bean source file(.java file)
              here is my jsp file:
              <%@ page language = "java" contentType = "text/html" %>
              <html>
              <head>
              <title>bean2</title>
              </head>
              <body>
              <jsp:usebean id = "ud" class = "userbn" >
              <jsp:setProperty name = "ud" property = "*" />
              </jsp:usebean>
              <ul>
              <li> name: <jsp:getProperty name = "ud" property = "name" />
              <li> email : <jsp:getProperty name = "ud" property = "email" />
              </ul>
              </body>
              <html>
              here is my bean :
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              import java.io.*;
              public class userbn implements Serializable
                   private String name ;
                   private String email;
                   public void setName(String n)
                        name = n;
                   public void setEmail(String e)
                        email = e;
                   public String getName()
                        return name;
                   public String getEmail()
                        return email;
                   public userbn(){}
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              pls help me.
              Thanks
              sravana.
              

              You realy can do it like Xiang says, but the better way is to use packages. That's
              the way BEA is designed for. If you use packages you can but your bean classes
              in every subfolder beneath Classes. Here for example we have the subfolders test
              and beans:
              You have to declare the package on top of your Bean Source Code:
              package test.beans;
              In your JSP you don't need the import code of Xiang. You only have to refer the
              path of your bean class:
              <jsp:useBean id="testBean" scope="session" class="test.beans.TestBean" />
              There are some other AppServers that only can deploy Java Beans in packages. So
              if you use packages you are always on the right side.
              ciao bernd
              "sravana" <[email protected]> wrote:
              >
              >Thank you very much Xiang Rao, It worked fine.
              >Thanks again
              >sravana.
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >><%@ page import="userbn" language = "java" contentType = "text/html"
              >>%> should
              >>work for you.
              >>
              >>
              >>"sravana" <[email protected]> wrote:
              >>>
              >>>HI ,
              >>>
              >>>I am using weblogic6.0 sp1.
              >>>
              >>>i have problem with jsp and java beans.
              >>>
              >>>i am using very simple java bean which stores name and email
              >>>
              >>>from a html form.
              >>>
              >>>but i am getting following errors:
              >>>
              >>>________________________________________________________________
              >>>
              >>>Full compiler error(s):
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              >>>"userbn"); //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>3 errors
              >>>
              >>>____________________________________________________________
              >>>
              >>>in which directory should i place java bean source file(.java file)
              >>>
              >>>here is my jsp file:
              >>>--------------------------------------------------------
              >>>
              >>><%@ page language = "java" contentType = "text/html" %>
              >>><html>
              >>><head>
              >>><title>bean2</title>
              >>></head>
              >>><body>
              >>><jsp:usebean id = "ud" class = "userbn" >
              >>><jsp:setProperty name = "ud" property = "*" />
              >>></jsp:usebean>
              >>><ul>
              >>><li> name: <jsp:getProperty name = "ud" property = "name" />
              >>><li> email : <jsp:getProperty name = "ud" property = "email" />
              >>></ul>
              >>></body>
              >>><html>
              >>>
              >>>-------------------------------------------------------------
              >>>
              >>>here is my bean :
              >>>
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>import java.io.*;
              >>>
              >>>public class userbn implements Serializable
              >>>{
              >>>
              >>>     private String name ;
              >>>
              >>>     private String email;
              >>>
              >>>     public void setName(String n)
              >>>     {
              >>>
              >>>          name = n;
              >>>     }
              >>>
              >>>     public void setEmail(String e)
              >>>     {
              >>>
              >>>          email = e;
              >>>     }
              >>>
              >>>     public String getName()
              >>>     {
              >>>
              >>>          return name;
              >>>     }
              >>>
              >>>     public String getEmail()
              >>>     {
              >>>
              >>>          return email;
              >>>     }
              >>>
              >>>     public userbn(){}
              >>>}
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>pls help me.
              >>>Thanks
              >>>sravana.
              >>>
              >>
              >
              

  • Problem with forward

    In my start page - page1.jsp I use directive <jsp:forward page="page2.jsp">. On the page2.jsp I want to make some action after form submit, but as soon as execute method submit for this form (where is page2.jsp), immediately occurs return on page1.jsp.

    Its OK but I want slightly make clear situation. On page1.jsp I have:
    <code>
    <%String mode = request.getParameter("mode");
    if(mode!=null && mode.equals("edit")) {
    session.setAttribute("attr",(String)"attr");%>
    <jsp:forward page="page2.jsp"/>
    <%}%>
    </code>
    On page2.jsp if String attr=(String)session.getAttribute("attr") is not null I show data on the form, don't submit. Data will be edit and when happens submit, possible 2 case: insert data(if this form was called from other page) or update data(in this case - if attr!=null).
    <code>
    <%String attr = (String)session.getAttribute("tabnum");
    if(incomingTabNum!=null && request.getParameter("tabel_num")==null) {
    bean1.getInfo(attr); //show data
    return;
    //save form parameters
    out.println("<script>alert('Save')</script>");
    String tabelNum = request.getParameter("tabel_num");
    out.println("<script>alert('"+session.getId()+"')</script>");
    person = new String[32];
    for(int i=0;i<32;person="",i++);
    request.getParameter("_some_");
    if(attr!=null) {
    bean1.update(params);
    else
    bean1.insert(params);%>
    </code>

  • 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 getPrimaryKeys method in DatabaseMetaData

    I'm using the above mentioned method to get primary keys from a DB2 database. I estimate that 95% of the time it performs as expected, but there are 7 tables in my database, that as far as I can see, are no different to any others and it fails to work with these. Looking at the tables in the DB2 control centre shows them all having keys, no different to any of the other tables. Also of note is that the tables it fails on are next to each other, it fails on tables 68 and 69, 135 and 136 and 200,201 and 202. Just wondering if anyone else has seen this problem before and if they found any solutions for it?
    Just ran through the program again and it's failed on a completely different set of tables, they're all sequential as well, could this be a problem with my connection to the db?
    Edited by: jnaish on Aug 14, 2008 7:38 AM

    post the ddl and code i guess
    i doubt this is related to your connection
    Also of note is that the tables it fails on are next to each other, i can't imagine that would be a problem, but sounds like it'd be easy for you to prove your theory with a simple test

Maybe you are looking for

  • Issue in updating the Huge XML by using updatexml function

    Hi All, Database Credentails: Oracle 9i R2. I have a huge xml like this, <Root> <abc></abc> <abc></abc> <abc></abc> </Root> The <abc></abc> will be more than 10000 under the <Root> tag. I have tried to update this xml by using the following script, f

  • Availability check of raw material during sale order processing

    Dear experts,                        When i am entering the finished good in sale order processing,system should check the raw material availabilty.Is it possible in STD sap Regards, murali.R

  • How do I post

    Is it me? am I the stupid one?. I've got a problen with call quality, of course with Skype the problem is always with the user, so I thought I'd ask the community. But how do you make a post to the community to ask others, is it me? am I stupid?, I j

  • Same Effects Panel parameters-different results on Tiff & Psd file format?

    Just a quick question to all the users and the Adobe Lightroom team & see if anybody has the same problem. I have one file saved in a Tiff format & the exact duplicate saved in a PSD, however when I sync the Effects Panel settings between the two, I

  • Print preview for quotation

    Hello friends, I have maintained the VV11 record but still i am not able to see the print preview of the quotation? I am not sure about the steps for output? Will you please tell me the steps for the output control for quotation? as well as once it i