JSP 2.0 books

I was wondering if there were any good JSP 2.0 books available in the market - I am looking for ones covering the new features like tag files, simple tags, JSP fragments, dynamic attributes, etc.
Thanks.

I don't know of any book available yet, but I would check www.raibledesigns.com. Matt Raible has been working on a functional demo app for JSP2.0 that will be part of Professional JSP 2.0 (now being published by Apress - used to be Wrox).
You can find the app at:
http://raibledesigns.com/wiki/Wiki.jsp?page=SecurityExample
Hope this help.
David.

Similar Messages

  • New to jsp, need good book to read

    hey all, other than the java pages, where would be some good info on properly setting a tomcat server and the j2ee sdk?
    i will also be requiring a book to read about jsp, so if anyone can find anything good, please let me know.

    Also you could go to
    http://www.manning.com/catalog/index.php
    and pick out an eBook for yourself at 1/3 the price of a hard copy.
    I wouldn't reccomend reading through free introduction courses you download off the net, you'll be going back and forward and basically going no where. Pick your self 1 or 2 books off this site and your on yur way.

  • Errors in a program jsp with javabeans

    With the following program time.jsp from the book bigjava by
    horstmann, I get from tomcat 5.0 the following errors. Who helps me?
    My O.S. is win pro.
    Thanks
    Eugenia Mariani
    this is the program:
    time.jsp
    inside the folder
    C:\Programmi\Apache Software Foundation\Tomcat 5.0\webapps\bigjava
    <jsp:useBean id="formatter" class="TimeFormatterBean"/>
    <jsp:setProperty name="formatter" property="date" value="<%= new
    java.util.Date() %>"/>
    <html>
    <head>
    <title>Time JSP</title>
    </head>
    <body>
    <h1>Time JSP</h1>
    <p>The current time is:
    <jsp:getProperty name="formatter" property="time"/>
    </p>
    </body>
    </html>
    this is the program TimeFormatterBean.java with
    TimeFormatterBean.class
    inside the folder:
    C:\Programmi\Apache Software Foundation\Tomcat
    5.0\webapps\bigjava\WEB-INF\classes
    import java.text.DateFormat;
    import java.util.Date;
    This bean formats the time of day from a given date.
    public class TimeFormatterBean
    Initializes the formatter.
    public TimeFormatterBean()
    timeFormatter = DateFormat.getTimeInstance();
    Write-only date property.
    @param aDate the date to be formatted.
    public void setDate(Date aDate)
    theDate = aDate;
    Read-only time property.
    @return the formatted time
    public String getTime()
    String timeString = timeFormatter.format(theDate);
    return timeString;
    private DateFormat timeFormatter;
    private Date theDate;
    these are the errors fro TOMCAT 5.0
    HTTP Status 500 -
    type Exception report
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    description The server encountered an internal error () that prevented
    it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /time.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Programmi\Apache Software Foundation\Tomcat
    5.0\work\Catalina\localhost\bigjava\org\apache\jsp\time_jsp.java:42:
    cannot resolve symbol
    symbol : class TimeFormatterBean
    location: class org.apache.jsp.time_jsp
    TimeFormatterBean formatter = null;
    ^
    An error occurred at line: 1 in the jsp file: /time.jsp
    Generated servlet error:
    C:\Programmi\Apache Software Foundation\Tomcat
    5.0\work\Catalina\localhost\bigjava\org\apache\jsp\time_jsp.java:44:
    cannot resolve symbol
    symbol : class TimeFormatterBean
    location: class org.apache.jsp.time_jsp
    formatter = (TimeFormatterBean)
    jspxpage_context.getAttribute("formatter", PageContext.PAGE_SCOPE);
    ^
    An error occurred at line: 1 in the jsp file: /time.jsp
    Generated servlet error:
    C:\Programmi\Apache Software Foundation\Tomcat
    5.0\work\Catalina\localhost\bigjava\org\apache\jsp\time_jsp.java:46:
    cannot resolve symbol
    symbol : class TimeFormatterBean
    location: class org.apache.jsp.time_jsp
    formatter = new TimeFormatterBean();
    ^
    An error occurred at line: 10 in the jsp file: /time.jsp
    Generated servlet error:
    C:\Programmi\Apache Software Foundation\Tomcat
    5.0\work\Catalina\localhost\bigjava\org\apache\jsp\time_jsp.java:63:
    cannot resolve symbol
    symbol : class TimeFormatterBean
    location: class org.apache.jsp.time_jsp
    out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((Time
    FormatterBean)_jspx_page_context.findAttribute("formatter")).getTime()
    ^
    4 errors
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultError
    Handler.java:83)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.
    java:306)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:398)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.
    java:507)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
    java:274)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:29
    2)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    note The full stack trace of the root cause is available in the Apache
    Tomcat/5.0.24 logs.
    Apache Tomcat/5.0.24

    Cross Post
    http://forum.java.sun.com/thread.jsp?thread=526883&forum=45&message=2528346

  • JSP won't compile my bean

    I get the follwing ereror when trying to run my JSP page. I know its the importing of a bean taht is acusing this error, but dont know how or why.
    My JSP is in webapps/examples/caravansite/caravanbooking.jsp, and the bean in webapps/examples/WEB-INF/classes/anp/DetailsStoreBean.class
    I am using the following code to try and access my bean:
    <%@ page import="../WEB-INF/classes/anp.DetailsStoreBean" %>
    <jsp:useBean id="booking" scope="session" class="DetailsStoreBean" />org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    import ../WEB-INF/classes/anp.DetailsStoreBean;
    ^
    public class caravanbooking$jsp extends HttpJspBase {
    ^
    2 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
         at org.apache.jasper.servlet.JspServlet.loadJSP(Unknown Source)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Unknown Source)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown Source)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
         at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.valves.CertificatesValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
         at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
         at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:539)
    Anybody have some ideas?

    i;m still have this error msg although my code same with above !!!
    why ??
    Apache Tomcat/4.0.5 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 3 in the jsp file: /sunAware_Project/EWSstep1.jsp
    Generated servlet error:
    /var/apache/tomcat/work/Standalone/localhost/marketing/sunAware_Project/EWSstep1$jsp.java:60: Class beans.RequireInfo2 not found.
    beans.RequireInfo2 info = null;
    ^
    An error occurred at line: 3 in the jsp file: /sunAware_Project/EWSstep1.jsp
    Generated servlet error:
    /var/apache/tomcat/work/Standalone/localhost/marketing/sunAware_Project/EWSstep1$jsp.java:63: Class beans.RequireInfo2 not found.
    info= (beans.RequireInfo2)
    ^
    An error occurred at line: 3 in the jsp file: /sunAware_Project/EWSstep1.jsp
    Generated servlet error:
    /var/apache/tomcat/work/Standalone/localhost/marketing/sunAware_Project/EWSstep1$jsp.java:68: Class beans.RequireInfo2 not found.
    info = (beans.RequireInfo2) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.RequireInfo2");
    ^
    3 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         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:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:534)

  • Execute thread to jsp

    Dear all
    if want to to execute run() this method in jsp script how can i do it
    That is my run() class
    and i would like to outupt String roger into my jsp page
    public class MyThread extends Thread{
    static Thread run;
         public static run() throws Exception {
              try{
                   while(true){
                        System.out.println("roger");     
                   Thread.sleep(1000);
                        //String s = null;
                   }catch(Exception e){
    <jsp:useBean id="book" class="checkserver.MyThread" />
    <%
    String a = "abc";
    out.println(a);
    book.start();
    %>
    when my call start() this method it doesnot out put roger in IE.

    The idea that I have is that you don't understand web technology.
    If what you are wanting is a web page that refreshes every 1 minute, this is not going to do it.
    The server will only send a response to a web client when the web client requests it. It cannot affect the browser once the response has been sent. If you want the page to refresh every minute, you will have to put some javascript on the page to do just that - window.setTimeout in javascript will run a javascript function after a certain amount of time - that might help you with what you need.
    Cheers,
    evnafets

  • Converting PHP to JSP

    For work I need to convert a code that I wrote in PHP to JSP in order for it to run on our windows server.
    Trouble is, I know very little java. The script is a very simple, short email script located here: http://pastebin.com/m7b4b4e96
    Any help would be greatly appreciated.

    Perhaps this one?
    http://www.amazon.com/Murachs-Java-Servlets-Andrea-Ste
    elman/dp/1890774189/ref=pd_sim_b_5_img/002-0859111-900
    5647I have read many many JSP and Servlet books in the past and the book you mentioned (Murachs-Java-Servlets book by Andrea Steelman) is the best by far above any other books.

  • JSP with J2SE and J2EE

    I am learning JSP from a book that is a year old. Can you tell me if the JSP for J2EE is different from that for J2SE ?

    J2SE stands for Java2 Standard Edition which is supposed to define Java standards (and API) to run day-to-day application (single user applications).
    J2EE on other hand is Java2 Enterprise Edition. Its supposed to define standards (and API) to be used to create server application that service multiple clients.
    One does not succeed the other, rather they target diffenet segments and are complementary. J2EE is more of extension of J2SE capabilities (A J2EE application will requires API defined in J2SE packages).
    JSP is part of the J2EE specification (other part being Servlets, EJB, JavaMail, JMS etc) and its supposed to have nothing to do with J2SE excepct using the latter's API in its implementation.
    What others have been trying to tell you is that JSP is part of J2EE specification but you need not know the other components of the specification to use JSP.
    Amitabh

  • Photo blog with JSP

    I would like to create a photoblog in which you could click on a forward or back button and it changes the photo being displayed, is JSP the right choice for this? i just dont want to create a billion html pages for each picture...I have never really used JSP, I have written servlets and scripts, I think I could wing JSP(I have books in case I need help). I was thinking I could have the buttons increment variables, have every picture numbered, thus changing the <img> tags. I dont know if this is possible, JSP may not even work like that, just my initial thought before I read up on JSP. Could someone just give me a push in the right direction....

    well I would like to use jsp just for the heck of it, I am going to have free time this christmas break so why not....
    as for the solution to this problem what do you think about the increment idea? is there maybe a better way of going about this? like I said I dont know much about jsp, so is it possible to have variables for the image tags so that every time I click on the forward button it increments a variable by one....the <img> tag source is labeled by a variable therefore when the variable is incremented it will change the picture

  • Driver class 'org.gjt.mm.mysql.Driver' not Found JSP

    OS ->Windows XP Pro
    Tomcat version ->4.0.1
    jdk version -> 1.3.1
    database -> mysql
    Classpath = .;C:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;C:\jakarta-tomcat-4.0.1\common\lib\mm.mysql.jdbc-1.2c\mysql_uncomp.jar;
    I am trying to run a function in a javabean to startup up a connection to a database. Code as follows...
    public void connect() throws ClassNotFoundException,
    SQLException,
    Exception {
    try {
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    con = DriverManager.getConnection(
    "jdbc:mysql://localhost/Wrox ?user=root&password=lunchbox ");
    } catch (ClassNotFoundException cnfe) {
    error = "ClassNotFoundException: Could not locate DB driver.";
    throw new ClassNotFoundException(error);
    } catch (SQLException cnfe) {
    error = "SQLException: Could not connect to database.";
    throw new SQLException(error);
    } catch (Exception e) {
    error = "Exception: An unknown error occurred while connecting " +
    "to database.";
    throw new Exception(error);
    I call it from my jsp page code as follows.. connect in bold
    <%@ page language="java"
    import="java.sql.*, java.io.*, java.util.*, com.wrox.databases.*"
    errorPage="error.jsp" %>
    <jsp:useBean id="book" class="com.wrox.databases.Books" />
    <html>
    <head>
    <title> Wrox Press Ltd. </title>
    </head>
    <body>
    <h1> Wrox Press Ltd.</h1>
    <h2> List of Books </h2>
    <b>Add More Books</b>
    <form action="delete.jsp" method="post">
    <table border="1">
    <tr>
    <td><b>ID:</b></td>
    <td><B>Title:</b></td>
    <td><B>Price:</b></td>
    </tr>
    <%
    book.connect();
    ResultSet rs = book.viewBooks();
    while (rs.next()) {
    %>
    <tr>
    <td>
    <input type="checkbox" name="pkey"
    value="<%= rs.getString("Title_ID") %>" />
    </td>
    <td><%= rs.getString("Title") %></td>
    <td><%= rs.getString("Price") %></td>
    </tr>
    <%
    %>
    </table>
    Check books for deletion.<BR>
    <input type="submit" value="Delete All Checked Books">
    </form>
    <% book.disconnect(); %>
    </body>
    </html>
    The name of the bean is correct and so is the package it is stored under. I tried it in the bean and got "ClassNotFoundException" Could not locate DB driver". I tried it with DBtags and got
    Driver class 'org.gjt.mm.mysql.Driver' not Found
    any help would be really appreciated.

    When using any 3rd party library with tomcat. the jar file of that library has to be put in the WEB-INF/lib directory of your application. Then only tomcat will find it.
    So the my-sql driver would have come in a jar file. just put that jar file in the WEB-INF/lib directory.
    After that things should work. If they don't please post again.
    hope this helps.
    regards,
    Abhishek.

  • Best books available?

    Can anybody give advice on a good book that covers Servlets from the basics to the most detailed features? I want one that covers the latest Java EE 5 features.

    You can start with Core Servlets and jsp, than move on to more servlets & Jsp.
    although these books do not cover very recent versions of the Servlet API but i found these very helpful when i started learning Servlets

  • Please Help with my first jsp

    Hi, this may seem basic to you but i've frying my head with simple jsp. Any books i looked at only show code segments!
    All i want to do is create an html entry page with form fields for username, password, email address, send the information to a jsp page that validates the form entries and then stores the info in database, and be able to display the info stored in the db also.
    Any help or pointers would be appreciated, or links to good tutorials!
    Thanks in advance.....

    with this i am sending my own code :
    its a html page :
    <Script LANGUAGE="JavaScript" ></Script>
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <html>
    <head>
    <title>Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="Microsoft Theme" content="expeditn 011">
    </head>
    <body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#993300" vlink="#666600" alink="#CC3300">
    <!--mstheme--><font face="Book Antiqua, Times New Roman, Times">
    <form name="frmlogin" method="post">
    <p> 
    </p>
    <p> 
    </p>
    <p> 
    </p>
    <p> 
    </p>
    <p>                                                       
    User Name : 
    <input type="text" name="txtname">
    <br>
    <br>
    Password   : 
    <input type="password" name="txtpassword">
    </p>
    <p>                                                                    
    <input type="submit" name="submit" value="Submit" onclick="javascript: return loadmy('sub')">
    </p>
    </form>
    <script>
    var i=0;
    function loadmy(val)
              if(val=="new")
                   document.frmlogin.action='form.jsp';          
              }else
                   if(onCheck())
                        document.frmlogin.action='login.jsp';
                   }else
                        return false;
    function onCheck()
         if(document.frmlogin.txtname.value=="")
              alert("Please enter user name ..");
              document.frmlogin.txtname.select();
              document.frmlogin.txtname.focus();
              return false;
         if( document.frmlogin.txtpassword.value=="")
              alert("Please enter password ..");
              document.frmlogin.txtpassword.select();
              document.frmlogin.txtpassword.focus();
              return false;
         return true;
    </script>
    <p> </p><!--mstheme--></font></body>
    </html>
    IN this page i am taking user name and password. ok?
    now another JSP file with database connection is here: I think you have enough idea for database connection. So i'll ommit that.
    <html>
    <head>
    <title>Login Result Page</title>
    <meta name="Microsoft Theme" content="expeditn 011">
    </head>
    <%@ page import="java.lang.*,java.sql.*"%>
    <%@ page import ="Database.*" %>
    <body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#993300" vlink="#666600" alink="#CC3300">
    <!--mstheme--><font face="Book Antiqua, Times New Roman, Times">
    <%
         String uname = request.getParameter("txtname");
    String password = request.getParameter("txtpassword");
         String pquery="Select * from login where uname='"+uname+"'";
         String query="Select * from login where uname='"+uname+"'and password='"+password+"'";
         ClsDataBase cdb = new ClsDataBase();
         Connection con = cdb.getConnection();
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery(pquery);
         if(rs!=null)
              if(rs.next())
                   ResultSet r=stmt.executeQuery(query);
                   if(r!=null)
                        if(r.next())
                        session.setAttribute("uname",uname);
                        session.setAttribute("Lflag","true");
    %>
    <p><font size=4 color="green">Wel Come <%= uname %>!!!</font></p>
    <p>
    <form action="listofuser.jsp" method="post" name="f1">
    </form>
    <%                    }
                        else
    %>
    <p> <font size=4 color="red">Wrong Password.</font> </p>
    <p><font size="4" color="green">Go back to login screen</font></p>
    <%
              else
    %>
         <font size=4 color="red">Invalid user....</font>
         <p><font size="4" color="green">Go back to login screen</font></p>     
    <%
         stmt.close();
         cdb.close();
    // conn.close();
    %>
    <!--mstheme--></font>
    </body>
    </html>
    hope this will help you. bye....

  • When to synchronize JSP?

    Is there a simple rule for when I should use the synchronized keyword in JSP and Java? Should I always use it when many threads change an instance variable, for example when I declare variables with <%! %> and many users look at the page? In that case how come so many books forget about this, when they do for example a simple page counter (using an instance variable). Do I ever have to use synchronized if I only read from an instance variable without changing it? What is really an atomic statement? Is for example "i=i+1" an atomic statement? If not, when can it get interrupted an what happens with the parts? Could you also confirm that I never need to use the synchronized keyword for local variables?

    Is there a simple rule for when I should use the
    synchronized keyword in JSP and Java? Whenever you have an instance variable in a class that will be accessed by multiple threads, you should synchronize on methods that use that variable if it is possible for a method to return a false value due to that variable's state changing.
    e.g.
    private int x = 10;
    private int y = 10;
    public void method1()
      System.out.println("x = "+x);
      System.out.println("y = "+y);
      //AAA
      System.out.println("x + y = "+(x + y));
    public void method2()
      x = x * 2;
    }In the above code, if a thread enters method1 with x and y both equal to 10, and executes the whole method within its allocated time slice, then
    x = 10
    y = 10
    x + y = 20
    will be printed to the console.
    But suppose the thread reaches the point marked AAA. If another thread takes over and executes method2, then when the first thread regains control, x will be 20, and the output would be
    x = 10
    y = 10
    x + y = 30
    This is obviously not the required behaviour, and can be stopped from happening by synchronizing the two methods.
    Should I always
    use it when many threads change an instance variable,
    for example when I declare variables with <%! %> and
    many users look at the page? Probably, yes. However, it does take at least 4 times as long to call a synchronized method as it does to call a non-synchronized one, so so if you can be sure that the above behaviour won't happen, don't synchronize.
    If you are setting a variable in different places, but there are no methods that need to read the variable more than once, then you can probably get away without having to synchronize.
    In that case how come so
    many books forget about this, when they do for example
    a simple page counter (using an instance variable). You tend not to read somehting like a page count more than once within a page, so it'll be correct at the point its used.
    Synchronization is often not covered in JSP and servlet books because if you're reading them, you should probably already know Java and are expected to know about synchronization.
    Do
    I ever have to use synchronized if I only read from an
    instance variable without changing it? No.
    What is really
    an atomic statement? Is for example "i=i+1" an atomic
    statement? Yes. Every Java statement is executed as if it were an atomic statement (I remember reading that somewhere, but I'm not sure where).
    If not, when can it get interrupted an what
    happens with the parts? Could you also confirm that I
    never need to use the synchronized keyword for local
    variables?Confirmed. Each thread gets its own local variables.

  • Questions on URLs and dynamic navigation rules

    Hello,
    I am new to JSF, so any help is appreciated. I am trying to do the following:
    Dynamic display URI - users submit multiple parameters for a search. The URL needs to change depending on search parameters they submit. For example, if they search by state the URL must be changed to /state_name, ex: "/maryland"...

    Yes and no... Searches can be made for different types of items. The same search form and search dispatcher are used, but each type has it's own display JSP for search results.
    For example, searches for books are displayed as "/books/....", audio is displayed as "/audio/..." using different JSPs. Each item type has it's own parameters that may end up in the URI, but they share a search form. Searching for a book in Maryland should change the URI to "/book/maryland/" and use a JSP that displayes Book search results. Searching for classical music should change the URI to "/audio/classical", etc.
    "/book/maryland/" and "/book/california/" will use the same JSP, and so will "/audio/classical" and "/audio/rock". Different JSPs will be used for "/book/*" and "/audo/*"

  • Error: Class java.util.ArrayList not found in import

    Bear with me, I'm learning. That's part of the problem.
    I'm trying to teach myself JSP using a book based on Tomcat, but running it on an Oracle 9iAS server that I don't control. (The DBAs do that.) I'm running into constant problems compiling and using classes and such, I think because of the different directory structures on the two servers. (See subject error.)
    So, what I'd like to know is: how do I set up a default/main/whatever-you-want-to-call-it directory under which I can store my practice applications, such that 9iAS will function correctly? We're not using OC4J as far as I can see (no such directory, though there is a J2EE_containers folder), just JServ. Or, conversely, can someone explain in simple terms the basic 9iAS directory structures for deploying apps on 9iAS? I've been 'round and 'round the Oracle documentation until my head spins, and can't find this basic information.
    Help, please!!

    You will have to make Kawa to use the correct jdk
    Look into
    Options-> Directory
    Make a new Profile if it point to your old jdk version
    Thanks
    Joey

  • How can I get content of  xml elements?

    Hello everybody,
    here is my xml document and my code which parses xml. I want to print content of all elements from xml to console but result is only null. But names of all elements shows correctly. Where is problem? Thank you in advance
    XMLSample.java
    import java.io.File;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class XMLSample {
         private void getAttribute(Document doc) {
    NodeList list = doc.getElementsByTagName("*");
    for (int i=0; i<list.getLength(); i++) {
    // Get element
    Element el = (Element)list.item(i);
    System.out.println(el.getNodeName());
    System.out.println(el.getNodeValue());
         private Document executeXML(String[]argv) {
              if (argv.length != 1) {
                   System.err.println("Usage: java DomEcho filename");
                   System.exit(1);
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              Document doc = null;
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(argv[0]));                         
              } catch (SAXException sxe) {
                   // Error generated during parsing)
                   Exception x = sxe;
                   if (sxe.getException() != null)
                        x = sxe.getException();
                   x.printStackTrace();
              } catch (ParserConfigurationException pce) {
                   // Parser with specified options can't be built
                   pce.printStackTrace();
              } catch (IOException ioe) {
                   // I/O error
                   ioe.printStackTrace();
              System.out.println("doc > " + doc);
              return doc;
         public static void main(String argv[]) {
              XMLSample dom = new XMLSample();
              Document doc = dom.executeXML(argv);
              dom.getAttribute(doc);
    library.xml
    <library>
    <book>
    <author>
    Jan Zitniak
    </author>
    <title>
    JSP Guru
    </title>
    </book>
    <book>
    <author>
    Jan Zitniak
    </author>
    <title>
    JSP Guru
    </title>
    </book>
    </library>

    If you have XML like:
    <target>value</target>What you actually have in DOM is:
    Element
       TextCall getFirstChild() on the Element and cast the result as Text. Then call getNodeValue() on the Text node.
    - Saish

Maybe you are looking for

  • Why can I receive emails but not send them?

    I have an iPhone 4, and I recently updated to iOS 7. Since the. I have not been able to send any emails. I am able to receive them, but not send them. I keep getting an error message saying that something is wrong with my password or username. I have

  • Music files taking up internal space

    I am trying to free up space on my 80GB internal HD. I am at 65GB currently. I ran disk inventory and it reported 10GB of music under my desktop folder/emusic. I do have that folder on my desktop to keep track of my downloads then I empty it. Nothing

  • MRP - Not creating PR on external vendor

    Hello all, I have following problem - I to have PR generated thr' MRP automatically for vendor supplying final product and also for a vendor who is subcontractor. Currently, PR is generated on to vendor who is subcontractor and not to other vendor su

  • E-Commerce Gateway POI records 9202 and 9203

    In Oracle EBS version 12.1.3, e-Commerce Gateway, what is the purpose of and how do you use the 9202 and 9203 records in the inbound purchase order (POI) document layout definition?  Is there, and where is, published documentation concerning this fun

  • Standard Intefaces missing in FINBASIS 747

    Hi We are using the standard FSCM interfaces in our system, We imported the latest version of FINBASIS SWCV (i.e. FINBASIS 747)  in SAP PI. In this i can see that FSCM objects are missing. PFB the screenshot. Can anyone help on this? Is it removed in