Design View blank, JSP and Java views fine

I'm running JSC 2.1, I have 2 gig of memory. I'm not able to see the design view on one of my jsps, but the error message in the log isn't very helpful.
I did a cut-and-paste from another jsp view in another file -- is there something else I have to copy? If so, what and where to?
Any help appreciated.
Stack trace is below (I get five of the same errors with different line numbers; I'm only including one stack trace here):
java.lang.NullPointerException
at com.sun.rave.designer.DesignerTopComp.componentShowing(DesignerTopComp.java:868)
at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:233)
at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:205)
at org.netbeans.core.multiview.MultiViewPeer$SelectionListener.selectionChanged(MultiViewPeer.java:480)
at org.netbeans.core.multiview.MultiViewModel.fireSelectionChanged(MultiViewModel.java:224)
at org.netbeans.core.multiview.MultiViewModel.setActiveDescription(MultiViewModel.java:93)
at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:274)
at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:215)
at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:139)
at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:270)
at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:215)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:250)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
[catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I figured out the problem. The Java code had gotten out of sync with the jsp code, so the design view didn't know how to render the components. It's a pain to fix, but it can be done. Go through your jsp code component by component, and make sure there are declarations, getters, and setters for each id in the components. Also make sure the java code doesn't contain declarations, getters, and setters for any components that you didn't create (you can see these in the jsp view at the bottom of the file).

Similar Messages

  • Problem with JSP and Java Servlet Web Application....

    Hi every body....
    I av developed a web based application with java (jsp and Java Servlets)....
    that was working fine on Lane and Local Host....
    But when i upload on internet with unix package my servlets and Java Beans are not working .....
    also not access database which i developed on My Sql....
    M using cpanel support on web server
    Plz gave me solution...
    Thanx looking forward Adnan

    You need to elaborate "not working" in developer's perspective instead of in user's perspective.

  • JSP and Java Servelets, What do I need to get started?

    What do I have to download in order to start using JSP and Java Servelets? How do I test the codes after I've written something? Anyone?

    Right and you can download tomcat server from http://jakarta.apache.org/
    and do not forget to set java home path in tomcat.See it's documentation formore help on site itself.
    To test your codes for jsp put all your jsp,html,image and other resource files in tomcat's webaps's root directory.
    Put all your java class files of beans if used and servlet's class files in root's webinf's class directory.
    It will make sense to try very easy programs if u r a begineer .After starting the server post setting the java home path .(you can start it in bin directory's startup.bat file)
    All the best
    Ashish

  • Tree View through JSP and Java Script

    Hi,
    I am looking for code or ideas of a Tree Structure as shown in in the left side frame of admin console of Sun App server 7 on the browser. I need to create a tree structure which will work on the browser like it works on the Sun App Server 7 admin console. If you had any idea or code, please share with me. I would like to have some idea before I start building it. The tree will be build from the database. So any database design is also helpful. I am planning to have that tree using JSP and EJB.
    Please help. If you are not clear what I am looking for, then please drop a line in this forum, so that I can explain it fine.
    Thanks in advance.
    Amit

    You can use the JSP Tree Tag I have developed. This helps you both structuring the tree model itself + it takes care of displaying the tree in a nice way. You can change all HTML code used to display the tree. Also you can build trees dynamically instead of just displaying static trees. Take a look at it here:
    http://www.jenkov.dk/projects/treetag/treetag.jsp
    Kind Regards,
    Jakob Jenkov

  • Need Help Badly on Shopping Cart Using JSP And Java Servlet

    Hi All,
    This is the 1st time i am trying to create a shopping cart using JSP and Servlet.
    I have read through a few acticles but i still do not get the whole idea of how it works.
    Please guide me as i need help very badly.
    Thanks.
    This is one of the jsp page which displays the category of products user would like to buy : Products.jsp
    <html>
    <head>
    <title>Purchase Order</title>
    </head>
    <body topmargin="30">
    <table border="0" width="100%" id="table1" cellpadding="2">
         <tr>
              <td bgcolor="#990000" width="96">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Code</font></b></td>
              <td bgcolor="#990000" width="260">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Description </font></b></td>
              <td bgcolor="#990000" width="130">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Brand
              </font></b></td>
              <td bgcolor="#990000" width="146">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">UOM
              </font></b></td>
              <td bgcolor="#990000" width="57">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Unit<br>
              Price </font></b></td>
              <td bgcolor="#990000" width="62">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Carton<br>
              Price </font></b></td>
              <td bgcolor="#990000" width="36">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">
              Qty</font></b></td>
              <td bgcolor="#990000" width="65">
              <p align="center"><b><font face="Verdana" size="2" color="#FFFFFF">Add<br>
              To Cart</font></b></td>
         </tr>
    <tr>
    <td align="center" width="96" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">123</font>
    </td>
    <td align="center" width="260" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Tom Yam</font>
    </td>
    <td align="center" width="130" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Nissin</font>
    </td>
    <td align="center" width="146" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">12 x 10's</font>
    </td>
    <td align="center" width="57" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">$3.85</font>
    </td>
    <td align="center" width="62" bgcolor="#CCCCCC">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">$46.2</font>
    </td>
    <td align="center" width="36" bgcolor="#CCCCCC">
    <!--webbot bot="Validation" S-Data-Type="Integer" S-Number-Separators="x" -->
    <p align="center"><input type="Integer" name="Q10005" size="1"></p>
    </td>
    <td align="center" width="65" bgcolor="#CCCCCC">
    <p><input type="checkbox" name="checkbox" value="123"></p>
    </tr>
    <tr>
    </table>
    <table border="0" width="100%" id="table2">
         <tr>
              <td>
              <div align="right">          
                   <input type="hidden" name="hAction" value="AddToCart"/> 
              <input type=submit name="submit" value="Add To Cart"/>                     
    </div>
    </td>
         </tr>
    </table>
    </body>
    </html>
    After user has make his selection by entering the qty and ticking on the check box, he would click the "Add To Cart" button ... and this would call my servlet : AddToAddControlSerlvet.java
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;
    import java.util.*;
    import java.util.ArrayList;
    public class AddToCartControlServlet extends HttpServlet
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException
              String action = req.getParameter("hAction");
              if (action.equals("AddToCart"))
                   addToCart(req,res);
         public void addToCart(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              try
                   String url = "";
                   String[] addList = req.getParameterValues("checkbox");
                   HttpSession sess = req.getSession(true);
                   //String sessionID = sess.getId();
                   DBClass dbClass = new DBClass();
                   ArrayList cartList = new ArrayList();
                   for (int i = 0; i < addList.length; i++)
                        String productCode = (String)addList;
                        int qty = Integer.parseInt(req.getParameter("Q"+productCode));
                        Products product = dbClass.getProductDetail(productCode);
                        double totalUnitAmt = qty * product.getUnitPrice();
                        double totalCartonAmt = qty * product.getCartonPrice();
                        Order order = new Order(product.getProductCode(),product.getProductDesc(),product.getBrandName(),product.getUom(),qty,product.getUnitPrice(),product.getCartonPrice(),totalUnitAmt,totalCartonAmt);
                        cartList.add(order);
                   sess.setAttribute("cartList", cartList);
                   url = "/Cart/CartDetails.jsp";
                   ServletContext sc = getServletContext();
                   RequestDispatcher rd = sc.getRequestDispatcher(url);
                   rd.forward(req, res);
              catch (Exception e)
                   System.out.println(e);
    From here, i would get the list of items which user has selected and add to the cartList, then i would direct the user to CartDetails.jsp which displayed the items user has selected.
    From there, user would be able to remove or to continue shopping by selecting other category.
    How i do store all the items user has selected ... everytime he would wan to view his cart ...
    As i would be calling from jsp to servlet .. or jsp to servlet ... and i do not know how i should go about in creating the shopping cart.

    Hi !
    Yon can use a data structure as vector and store the items selected by the user into the vector . Keep the vector in session using session object , so the user can access the entire shopping cart from anywhere in the application .
    Then , you can change the cart accordingly .
    Hope this works.
    Cheers ,
    Pranav

  • What's the relationship between JSP and Java?

    hi,dear friends here.......^_^ I'm a graphic/web designer,
    cause the needed of internet web design, I started to learn html and Java server page.But I never have experience of JAVA programs. It's kind of hard for me to know and use JSP now.Should i need to learn Java first? Or can anyone tell me what's the good way for me to
    learn JSP?
    I also want to learn how do make a web page as the first page of java.sun.com about "Industry News ".
    Thanks !!grace from Taipei,Taiwan

    Hi! JSPs allow Java code together with HTML in one document. The servlet engine "compiles" a JSP into a servlet prior to executing it. So, one must know Java prior to dealing with JSPs.
    IMVHO, "Thinking In Java" by Bruce Eckel is a very good book for introduction to Java. You can download the electronic version at no charge from http://www.bruceeckel.com.
    After you get a good handle on Java, "Professional Java Server Programming" (Wrox Press) can give you good information on servlets and JSPs, along with some other related topics.
    Hope this helps!
    Cheers!

  • New to Jsp. Jsp and java bean not running

    hi
    i have created a simple jsp file and using a java bean. but it is showing errors. my file directory structure in tomcat4.1 is:
    aptechsamples:
    index.jsp
    WEB-INF/classes:
    myPackage:
    Counter.class
    i have no web.xml file i dont know how to use it or not. i need it or not.
    the index.jsp file:<html>
    <head><title> A Simple JSP Bean </title></head>
    <body>
    <%@ page language ="java" %>
    <%@ page import ="mypackage.Counter" %>
    <jsp:useBean id="id_counter" scope="session" class ="Counter"/>
    <jsp:setProperty name="id_counter" property="count" param="count" />
    <jsp:getProperty name="id_counter" property="count" />
    </body>
    </html>the Counter.java file is: package mypackage;
    public class Counter{
         String msg;
         public Counter(){
              msg = "Hello World";
         public String getCount(){
              return msg;          
         public void setCount(String c){
              msg = c;
    }please help me and tellme what the hell is wrong with it or me. im getting an error:
    exception
    org.apache.jasper.JasperException: Cannot create bean of class Counter

    Java is already telling you what is wrong: it cannot create an instance of your Counter class. The reason being: it can't find it.
    What do you mean by "myPackage"? Before you can use any class in your JSP's or servlets, they MUST be stored in a package. If you don't know what that is, I highly suggest you lookup "java package" and "java classpath" using google.
    Let's say your Counter class is in a package mypackage (so it starts with the line package mypackage;). Then you have to store the .class file as:
    WEB-INF/classes/mypackage/Counter.class
    If done correctly, the error message should disappear.

  • What's the difference between using java directly in JSP and java bean

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    1 Cleaner pages
    2 you have to write the class and use set and get methods
    3 What do you mean when saying passing string from jsp to html??, do you mean the value you can use <%=variablename%>

  • First use of jsp and java bean and "Unable to compile class for JSP" error

    Hi,
    I am trying to create my first jsp + java bean and I get a basic error (but I have no clue what it depends on exactly). Tomcat seems to cannot find my class file in the path. Maybe it is because I did not create a web.xml file. Did I forgot to put a line in my jsp file to import my bean?
    Thank you very much for your help.
    Here is my error:
    An error occurred at line: 2 in the jsp file: /login.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /usr/local/tomcat/jakarta-tomcat-5/build/work/Catalina/localhost/test/org/apache/jsp/login_jsp.java:43: cannot resolve symbol
    symbol : class CMBConnect
    location: class org.apache.jsp.login_jsp
    CMBConnect test = null;
    I only have this in my directory:
    test/login.jsp
    test/WEB-INF/classes/CMBConnect.java
    test/WEB-INF/classes/CMBConnect.class
    Do I need to declare another directory in classes to put my class file in it and package my bean differently?
    Here is my login.jsp:
    <%@ page errorPage="error.jsp" %>
    <jsp:useBean id="test" type="CMBConnect" scope="session" />
    <html>
    <head>
    <title>my test</title>
    </head>
    <body>
    <h3>Login information</h3>
    <b><%=session.getValue("customerinfo.message")%></b>
    <form> ....... </form>
    </body>
    </html>
    and here is my CMBConnect.java:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class CMBConnect
    public CMBConnect () { }
    public String openConnection(String id, String password) {
    String returnText = "";
    try {
    Connection con = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection("jdbc:oracle:thin:@myserver.abc.com:1521:TEST", id, password);
    if(con.isClosed())
    returnText = "Cannot connect to Oracle server using TCP/IP...";
    else
    returnText = "Connection successful";
    } catch (Exception e) { returnText = returnText + e; }
    return returnText;
    Thanks again!

    Thanks for you help
    I created the package and I get this error this time:
    javax.servlet.ServletException: bean test not found within scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • Serverlets, JSP and Java Web Start

    Hi As I have heard J2EE is used for serverlet's and JSP programming But JSP and Serverlet programming can be created and implemented using java web start which comes with J2SE what then is the difference between J2EE and J2SE

    Clarification:
    J2EE has an additional E in it, while J2SE as an additional S.
    Ok, now that we cleared that up, Lets see if I can answer your question.
    There is no magic button such as 'java web start' that will automatically generate computer code for you. You have to write java line by line and debug each and every line of code. A typical whole project may consist up up to 1500 functions (mine has over 12000). You read whole books on the subject as I discuss below and work through thier examples. Within about 2 or 3 years of hard study, you should be a pretty good programmer.
    Java is an object oriented language that you'll need to become familiar with that takes some practice to learn. Also, a java based web site consists of several technologies in addition to the java language that you'll need to be familiar with. Many programmers will read articles on the internet and pick up fragments of information on these various technologies and throw a web site together thats impossible to maintain and enhance. I think it would be better if you read whole books and experiment with the technologies. Consider it an at-come college course. Here is my suggested reading list read in roughly this order ( I suggest buying them one at a time via the internet (its cheaper) before moving onto the next book).
    "Thinking In Java" - Bruce Eckel
    HTML & XHTML: The Definitive Guide
    JavaServer Pages - Hans Bergsten
    Programming Jakarta Struts
    JavaScript: The Definitive Guide
    SAMs Teach Yourself SQL
    JDBC and Java
    Also, visit the Web Tools Platform (WTP) Project (www.eclipse.org/webtools) . Its a free Eclipse Java development tool that has the bulk of the java development IDE market (above even JBuilder).However, I suggest creating a few small java programs using the dos command line before you let this IDE do a lot of the work for you. You also might want to install some type of database (Oracle Lite, MySql, etc) on your computer so you have a database to play with (you'll need a computer with at least 2Gbytes of memory).

  • JSP and Java Beans with Database Problem

    hellow, this is my first posting and i hope to help me as fast as you can...
    my problem is simplly i cant get any data from the database (whatever the database it is, i test it with MS Access and MySQL server) when i use a bean, But if i put my connection statement in the JSP file thair is no problem... ???? !!!!
    for example i have a class "Authentication" that have a method to test if the username and password is correct or not and return 1 if true, 0 if false, -1 if thair are some problem in connecting DB.
    now if i create a normal java application that uses this method, it's work and no problems, BUT if i used a JSP page to use this method it's return allways -1

    T1 class:
    package VX;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    public class T1
    //public MBJDBConnection(String driver,String url)
    public T1()
    JDBC_DRIVER = "com.mysql.jdbc.Driver";//driver;
    DATABASE_URL = "jdbc:mysql://localhost:3306/rawafed?user=root;password=0000";//url;
    //=======DB CONNECTION===========================================
    private static String JDBC_DRIVER;
    private static String DATABASE_URL;
    protected Connection connection;
    protected Statement statement;
    //===========End DBC==============================================
    public int update(String sqlUpdate)
         int i=0;
              //connectDB();
              try{
                   i=statement.executeUpdate(""+sqlUpdate);
                   catch(Exception e)
                        System.out.println("Error Inserting Statement Or Connection Not Opened");
              //disconnectDB();
         return i;
    public ResultSet select(String sqlQuery)
              //connectDB();
              ResultSet rs;
              try
              {//open try
              rs=statement.executeQuery(""+sqlQuery);
                   return rs;
              }//end try
              catch(Exception e2)
                   //System.out.println("Error Selecting Statement Or Connection Not Opened");
              }//end catch
              //add to array list
         //return resultList;
         return null;
    //------Methods-------
    public void connectDB()
    //===========================Connection===================
    try
    Class.forName(JDBC_DRIVER);
    catch(Exception e)
    System.out.println("Error : FOR NAME");
    try
    connection = DriverManager.getConnection(DATABASE_URL, "root", "0000");
    catch(Exception e)
    System.out.println("Error : DB URL");
    try
    statement = connection.createStatement();
    catch(Exception e)
    System.out.println("Error : CREATE STATEMENT ERROR");
    public void disconnectDB()
    try
    statement.close();
    connection.close();
    catch(Exception e2)
    System.out.println("Error : CAN'T CLOSE DB");
    T2 Class
    package VX;
    // class Person.
    //Required Class : EDC.EDCDB
    import java.sql.*;
    public class T2
         public T2()
              //initialization
         //........................ Attributes .........................
         private String user;
         private String password;
         private T1 db=new T1();
         private ResultSet rs;
         //......................... Methods .........................
         public String getAdmin(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success and he is a regular employee 3: SUCCESS AND HE IS agent
              try
              user=u;
              password=p;
              rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=1");
              if(rs.next())
                   return ""+1;
              else
                   rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=2");
                   if(rs.next())
                        return ""+2;
                   else
                        rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=3");
                        if(rs.next())
                             return ""+3;
                        else return ""+0;
              catch(Exception e){System.out.println("Error \n"+e.getMessage());return ""+e.getMessage()+"\n"+(-1);}
         public int getCard(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success
              user=u;
              password=p;
              try
              db.connectDB();
              rs=db.select("SELECT Card_ID,password FROM Card WHERE Card_ID='"+user+"' AND password='"+password+"'");
              if(rs.next())
                   return 1;
              return 0;
              catch(Exception w)
                   return -1;
              finally
                   //System.out.println("Done");
                   db.disconnectDB();
         public int getAny()
              return 1;
    }//end class
    This is a tested class and it's work OK
    import VX.T2;
    public class T3
         public static void main(String [] args)
              System.out.println("System Started...");
              try
                   T2 t2=new T2();
                   System.out.println(t2.getCard("1","a"));
              catch(Exception e)
                   System.out.println("Opsssss ...");
    Now this is the JSP Code that OK and Run without any problems
    <%@ page contentType="text/html; charset=windows-1256" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
    <title>test</title>
    </head>
    <body>
    <%
    //Mazin B. Jabarin 20210464
    //Testing JSP - MySQL Server Driver
    String connectionURL = "jdbc:mysql://localhost:3306/EDCDB?user=root;password=0000";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try{
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL, "root", "0000");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM a");
    while (rs.next()) {
    out.println(rs.getString("id")+"<br>");
    rs.close();
    catch(Exception e)
    out.print("Error : "+e.getMessage());
    %>
    </body>
    </html>
    Now this JSP File always returns (-1) ???? !!!!!!!
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" import="VX.T2" import="java.util.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    try
    T2 t2=new T2();
    out.println("Result Still : "+t2.getCard("1","a"));
    catch(Exception w)
    out.println("<BR> Error In Execution ??? "+w.getMessage());
    %>
    </body>
    </html>
    ++++++++++++++++++++++++++++
    any one can help me please :(
    i use tomcat as web-application
    and i install jdk 1.5
    also JBulder 7
    (now i supposed that the JBulder make some conflict, so i uninstalled it but still Not Working) ...
    before one year i was working just like this way and it was working
    but now i dont know what is the problem
    i am really need help.

  • HELP!!!!! JSP and Java Script

    Hi,
    I have a JSP file that I need to create 3 drop lists (choice list). If one of these 3 choice lists is selected, then the other 2 need to deselected and disabled. I need help with the code.
    Do I use JavaScript or Java? Below is the html code. I would really appreciate any help on this.
    Thanks,
    BK
    <!--
    Refer to the directory gary/reportingstd/getReqs.jsp to see how to get the value from the
    choice list and other fields.
    -->
    <html>
    <head><title>New Window Example</title>
    <STYLE TYPE="text/css" >
    td { font-size: 11px }
    th { font-size: 11px }
    body { background-color: #666666 }
    </STYLE>
    <SCRIPT>
    /* When press CANCEL button, the dialog box disappears. */
         function Closer()
              window.close();
         function checkForm()
         var f = document.queryForm;
    * Checks if an account number is entered. If not, an error message dialog pops up
    * to the user.
    * Checks if a business unit was chosen. If not, an error message dialog pops up
    * to the user.
         buChoice = f.buList.selectedIndex;
              if (f.buList.options[buChoice].value == "")
                   alert("Please choose a business unit.");
                   f.buList.focus();
                   f.toDate.select();
                   return false;
         * This <code>statusMsg()</code>is to give the user feedback while data is being entered by
         * creating a status message. This script lets you modify what is displayed in this bar,
         * giving you the ability to send messages to the user while he interacts with filling out
         * the fields.Status Messages are the phrases you see in the status bar at the bottom of a
         * window or dialog.
         * For instance: For the account number text field, as long as the cursor is in this text
         * field of Account #, there's a message at the bottom of the dialog box informing, " Enter
         * only numeric characters."
         * @param msgType
         * @ mesage the data structure to store the messages sent to the users
         function statusMsg(msgType)
    var message = "";
    if (msgType == "integer")
    message = "Enter numeric characters.";
    if (msgType == "integerDate")
    message = "between 1990 and 2010";
    if (msgType == "ListBU")
    message = "Choose which BU?";
    if (msgType == "ListMonth")
    message = "Choose a month."
    window.defaultStatus = message;
    window.status = message;
    </script>
    </head>
    <body onFocus="statusMsg('')">
    <FORM NAME= "queryForm" onSubmit = "return checkForm()" ACTION="Welcome.html">
    <TABLE Border="0" cellspacing="2" cellpadding="4">
    <TR>     
    <TD ALIGN=left>Company Code:</TD>
    <TD WIDTH="20%"><SELECT Name=choiceMonths1 size=1 onFocus="statusMsg('ListMonth')">
    <option value="" selected>
    <OPTION Value="01">01
    <OPTION Value="02"> 02
    <OPTION Value="03"> 03
    <OPTION Value="04"> 04
    <OPTION Value="05"> 05
    <OPTION Value="06"> 06
    </SELECT></TD>
         <TR>
         <TD ALIGN=left>RegionID:</TD>
         <TD><select name=buList onFocus="statusMsg('ListBU')"> // onChange = "selectionMade()"
         <option value="" selected>
         <option value=Norht ALIGN="left">North
         <option value=East ALIGN="left">East
              <option value=South ALIGN="left">South
         <option value ALIGN="left">North</select></TD></TR>
    <TR>
         <TD ALIGN=left>Business Unit ID:</TD>
         <TD><select name=buList onFocus="statusMsg('ListBU')"> // onChange = "selectionMade()"
         <option value="" selected>
         <option value=TBR ALIGN="left">TBR
         <option value=BAL ALIGN="left">BAL
         <option value ALIGN="left">ABH</select></TD></TR>
    </TR></TABLE>
    <TABLE>
    <tr>
    <TD><INPUT TYPE=submit Value=Submit></TD>
    <TD><INPUT TYPE=button NAME=btnClose VALUE=Cancel SIZE=20 ALIGN= center onClick="Closer()"></TD>
         <TD><input type=reset VALUE= Clear Query SIZE=20 ALIGN= right></TD></TR></TABLE>
    </FORM>
    </BODY>
    </html>

    What i've done in the past in this same situation is to use radio buttons alongside my dropdown lists. Whenever a radio button is selected, the corresponding dropdown list is enabled, and the other lists are all disabled. Not too hard to implement in Javascript either. Use an onClick() and set the other fields to disabled, using document.form.field.disabled = true. (and obviously, set the one you want to disabled = false). But obviously, you're still going to want to know which one to retrieve later, right? Use a hidden tag and in the same Javascript onClick, you can dynamically set the variable to whatever you want. Here's a pretty compact example using 2 fields
    function enable(field)
         if(field == "firstName")
              document.myForm.firstName.disabled = false;
              document.myForm.lastName.disabled = true;
              document.myForm.searchBy.value = "firstName"
         else
              document.myForm.firstName.disabled = true;
              document.myForm.lastName.disabled = false;
              document.myForm.searchBy.value = "lastName"
    }Or something like that. Yeah, I know it's not the greatest javascript in the world, but i was just simplifying things to give an example. Hope this helps somewhat :)
    Simon

  • Better Design for EJB 3 and Java Web Dynpro

    Hi all,
    When using EJB Model on CE, to each method a Request and Response are generated. To a CRUD i've 4 methods.
    I've a Foo (JPA Entity).
    public Foo create(Foo)
    public Foo update(Update)
    public void remove(Foo)
    public List<Foo> findBy...
    I think that i could use a Single view for both create and update method. But i will need a separated context objects to each function.
    Request_<Bean>_create
    Request_<Bean>_update
    What is better in this case? a single method createOrUpdate on my EJB? Or a View to each operation?
    Best regards

    Hi all,
    Just to share my decision:
    My EJB continue with the methods.
    public Foo create(Foo)
    public Foo update(Update)
    public void remove(Integer)
    public List<Foo> findBy...
    Was generated one Request to each method.
    Request_<Bean>_create
    Request_<Bean>_update
    I've mapped the both on my Component controller and have created on view to edit and create a new record.
    When the record already exists i'm initializing the Request_<Bean>_createElement with record data, when is a new i've just initialize the new Foo object and put on currentElement of update.
    On the generic save method of controller, a test is done to decide if the Request<Create> or Request<Update> model Object.
    Best regards

  • How can I change between JSP and Java in the page language attribute

    Does any one know the answer to this? I am trying to Switch between the 2 in the middle of the page. I want to include a file that uses <%@ page language = "JAVA" %> but the main mage uses Java Script. How can I switch it for this one file. I can't find the answer anywhere. Thanks for your time, and please help me. Also can some one post a good link for Session Tracking. I can't find much good information on that. Thanks again.
    Eagles757(JAY)

    Wow this didn't make sense in so many ways. It's truly bordering on nonsense. I think it's written in English.
    <%@ page language="Java" %>This is optional. JSPs don't use any language other than Java. This is known as a JSP Directive. This line will be processed by the JSP/Servlet engine, and you won't see it in your output. If JSP ever supported a language other than Java, this would be where you would change it.
    <script type="text/javascript">
    <!--
    // -->
    </script>You can include a block like this in your JSP file. The JSP/Servlet engine will not process this script block at all (unless you include JSP <% %> tags somewhere in there, in which case they will be processed before the response is sent back to the web browser). This script block is where JavaScript goes. This code will be executed on the client's browser.
    This is about as clear as I can make things given how muddled your question is. Please ensure you understand the basic differences between JSP, Java, JavaScript, HTML, Servlet engine, web browser before proceeding. Understand what code executes where, and in what order.
    Brian

  • Plain JSP and java:  can any one help .

    I explained below the logic
    each declaration & loop has comment
    if possible please try it
    After you run this code it will work fine as many as entris you want
    Just make some changes remove comment marked with @ then run again the same program for more than 26 entries it will not work ..
    I want this code to work for any no of entries user selected . minimum 30-35
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <script type="text/Javascript" language="Javascript">
    function goto()
      document.forms[0].submit();
    </script>
    </head>
    <body>
    <%
    /* this block declares the array elements  for storing the values when page is submitted*/
         String len="";
        String arr_sr_no[]=null ;
         String arr_frmdeler_nm[]=null;
         String arr_frm_dest[]=null;
          String arr_todeler_nm[]=null;
          String arr_to_dest[]=null;
          String arr_mode_trans[]=null;
          String arr_fare[]=null;
       /* When page get submitted values are stored in theese array elements */  
          arr_sr_no=request.getParameterValues("sr_no");
          arr_frmdeler_nm=request.getParameterValues("frm_dlr_name");
          arr_frm_dest=request.getParameterValues("frm_dest");
          arr_todeler_nm=request.getParameterValues("to_dlr_name");
          arr_to_dest=request.getParameterValues("to_dest");
          // @ arr_mode_trans=request.getParameterValues("transport_mode");
          arr_fare=request.getParameterValues("fare");
       /* Array of serial number is null for first time when page gets loaded so i initialized
         the len="1";
        if(arr_sr_no==null)
               len="1";          
      /* when array of serial  is not null when page gets loaded
         i initialized len with the length of the array of serial number i.e arr_sr_no[]
            if(arr_sr_no!=null)
               int i = arr_sr_no.length;
               len = Integer.toString(i);
            // Converted String  len into Integer
             int add_cnt = Integer.parseInt(len);
           /* this line gets the value from Select combo which select  no. of rows  to be generated
            for table entries */
            String str2=request.getParameter("no_statements");
            String str3="";
          //when  str2 is not null initialize the str3 with str2.
          // This is for that how many rows we have selected in  <select> tag
          //else part is for first time when page is loaded
          // so that one row will be defaultly created
           if(str2!=null)
              str3=str2;
            else
              str3="1";
          //converted String to integer..
             int entry=Integer.parseInt(str3);
    %>
    <form name="myform" >
    <table width="500" border="1" >
        <tr>
           <%--This is Select tag which Selects the No of Rows whch onChange calls goto()
               and page gets submitted
           --%>
               <select  name="no_statements" onChange="goto()">
                      <%
                          int cnt;
                         for( cnt=1;cnt<=30;cnt++)
                      %>
                          <option value="<%=cnt%>" <% if(entry==cnt) out.println("selected");%>> <%=cnt%> </option>
                      <%
                      %>
                      </select>   
               </td>
    <%
      /*  This for loop gets the iterates for Selected no of Rows in <SELECT> tag
       "entry" variable is initialized above for selected rows
           for (int i=1;i<=entry;i++)
                  String strdlr_name="";
                  String strfrm_dest="";
                  String strtodeler_nm="";
                  String strto_dest="";
                   String trans_mode="0";
                    String strfare="";
            /* This condition checks for any array is not null*/
            if(arr_sr_no!=null)
                    /* this array checks for each time that i is less than add_cnt
                       where add_cnt is length of arr_sr_no[] (which is in turn length
                       of each array we have stored above)
                       This cond'n ensures that no null pointer assignment is done
                    if(i<=add_cnt)
                       /* we initializes each element of each array serially to
                        local String variables */
                       strdlr_name=arr_frmdeler_nm[i-1];
                       strfrm_dest= arr_frm_dest[i-1];
                       strtodeler_nm= arr_todeler_nm[i-1];
                       strto_dest= arr_to_dest[i-1];
                       // @ trans_mode=arr_mode_trans[i-1];
                        strfare =arr_fare[i-1];
                      }// end of inner if
                  }// end of outer if
            %>
         <tr>
                <%-- here we assign local string  values to <input> box this will
                     this will ensure that all entris  will stay intact when page
                      gets submitted
                --%>
                <td><input name="sr_no" type="text" value="<%=i%>" size="2"></td>
                <td><input name="frm_dlr_name" type="text" value="<%=strdlr_name%>" size="16"></td>
                <td><input name="frm_dest" type="text" value="<%=strfrm_dest%>" size="11"></td>
                <td><input name="to_dlr_name" type="text" value="<%=strtodeler_nm%>" size="18"></td>
                <td><input name="to_dest" type="text" value="<%=strto_dest%>" size="11"></td>
               <%-- @ <td><select name="transport_mode" >
                        <option value="0" <%if("0".equals(trans_mode)) out.println("selected"); %>>--Select--</option>
                        <option value="1" <%if("1".equals(trans_mode)) out.println("selected"); %>>Air</option>
                        <option value="2" <%if("2".equals(trans_mode) )out.println("selected"); %>>Train</option>
                        <option value="3" <%if("3".equals(trans_mode)) out.println("selected"); %>>Bus</option>
                        <option value="4" <%if("4".equals(trans_mode)) out.println("selected"); %>>Taxi</option>
                        <option value="5" <%if("5".equals(trans_mode)) out.println("selected"); %>>Two Wheeler</option>
                        <option value="6" <%if("6".equals(trans_mode)) out.println("selected"); %>>Auto Rikshaw</option>
                     </select>
              --%>
           <td><input name="fare" type="text" value="<%=strfare%>" size="4"></td>
           </tr>
            <%
            }// End of For loop
            %>
    </table>
    </form>
    </body>
    </html>Hope you will reply
    it is very urgent

    No need to post it again. Particularly when it is right near the top.
    http://forum.java.sun.com/thread.jspa?threadID=765816&tstart=0

Maybe you are looking for

  • Book mark icon in Adhoc query?

    Hi, There is an Adhoc query created by the end user.The book mark icon available is not working but the CONTEXT MENU on any of the values is producing the book mark properly.Can just any one help me to find the solution of this? Why BOOK MARK ICON is

  • How do I add playback control to a .swf file in Director 11.5 (PLEASE HELP!)

    Hi, I am currently trying to add controls (play/stop/etc) to a .swf file within Director 11.5. The movie imports fine and plays perfectly, however there does seems to be built in options to add the control in the same way you would for a .mov. The .s

  • My ipod wont sync due to apple mobile device not startted

    I wonder if you could posible help me with my question? every time I want to sync my itnues, a message is displayed on the screen saying that my ipod cannot be used because the apple mobile device service is not started. what do I do?

  • Seeburger Adapter - Mappings

    Hi, I'm Using Seeburger AS2 Adapter for B2B Scenario. What type of mapping we can use...Means Message mapping, JAVA Mapping , XSLT Mapping and ABAP Mapping... and Why? Thanks and Regards, SReddy

  • Non-latin elements (=XML tag names) processing

    Hello there, How could I process XML with non-latin tag names? As far as I know, XI itself cannot map or interact with these XML elements nor design these names in IB. But I have to work with it and what should I do? The only way for me is to write E