Servlet,JSP,JSTL Book

I have a basic idea of JSP as well as Servlets but not much of JSTL. I even created a project using sessions in JSP as well as in servlets.I didnot use much of JSTL anyways. Now i want to dive deep into the three of these.Can you all suggest me the onw book i should refer for this purpose.
Some book comparable to Thinking in JAVA for CORE JAVA.

Any views..
I have heard Professional JSP is good..but i dont even find it on WROX site..has its name changed

Similar Messages

  • Class not found javax.servlet.jsp.jstl.sql.Result in Richfaces

    When I try to run the richfaces application using Weblogic 10.3 AS and Netbean IDE 6.9.1, I found ClassNotFoundException on javax.servlet.jsp.jstl.sql.Result class.
    I class path the following libs.
    commons-beanutils-core-1.8.0.jar
    commons-digester-1.8.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.2.jar
    commons-logging-1.1.1.jar
    glassfish.el_2.1.1.jar
    glassfish.jsf_1.2.9.0.jar
    javassist-3.8.0.GA.jar
    jhighlight-1.0.jar
    jsf-facelets.jar
    jsf-api.jar
    log4j-1.2.14.jar
    richfaces-api-3.3.0.GA.jar
    richfaces-impl-3.3.0.GA.jar
    richfaces-ui-3.3.0.GA.jar
    glassfish.jstl_1.2.0.1.jar
    Also I try to deploy without using some jar files already exists in application server.
    My web.xml configuration is-
    <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>#{skinSelector.skin}</param-value>
    </context-param>
    <context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>org.ajax4jsf.SKIN</param-name>
    <param-value>skin_name</param-value>
    </context-param>
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    I also try to configure <library-ref>....</libray-ref> configuration in weblogic.xml and weblogic-application.xml and I also deploy JSF-2.0.war as library in application.
    Please
    h5.MUTU

    So why didn't you think that the JSP forum here wasn't a good place to ask JSP questions like this one?
    You can use <c:for-each> with a List. That's how it's designed. I don't understand why you say you can't. Perhaps you were confused by the SQL tags in JSTL. But anyway, you should just return a List from your EJB and forget about using obscure internal JSP classes.

  • Servlets , JSP, JSTL ,etc

    Hello
    In my Web project , I have used servlets, JSP , JSTL and JDBC to develop a Website, and now I am preparing a report about it.
    Please forgive me if this question sounds "not very smart" , but kindly help. Is it correct to mention in my report I have used J2EE techologies and then briefly explain about JSP, Servlets, etc?
    Thank you
    Vajra

    Well this really depends on what purpose your report serves and what the person/organization you're submitting your report to requires.
    What have you been told to do? Do you have any template that you need to follow?
    If you don't have any, then I guess you could add a section on the technology used and add a brief description covering this.
    But really, this totally depends on your situation and requirements. No one can tell you what to do. And you wouldn't blindly follow advice given by anonymous strangers on an Internet forum for an important project report now would you? :D

  • Deployment error - Missing class: javax.servlet.jsp.jstl.core.Config

    Hi,
    We are using JDeveloper 10.1.3.0.4(SU5) on windows for development of ADF application. We need to deploy the developed application onto Oracle Application Server 10g (10.1.3) which is running on Solaris. We are using BC4J, WAR and EAR deployment profiles in jdeveloper to create the .war and .ear files.
    If I deploy the generated ear on a standalone OC4J server install on my windows PC, it works fine.
    Now when I deploy the generated .ear file onto the Oracle Application Server 10.1.3 through Application Server Control interface and then try to access the jspx pages under our application we are getting following error:
    oracle.classloader.util.AnnotatedNoClassDefFoundError:      Missing class: javax.servlet.jsp.jstl.core.Config     Dependent class: com.sun.faces.application.ViewHandlerImpl     Loader: accaweb.web.accaweb:0.0.0     Code-Source: /oracle/app/oracle/product/10gas3/j2ee/home/applications/accaweb/accaweb/WEB-INF/lib/jsf-impl.jar     Configuration: WEB-INF/lib/ directory in /oracle/app/oracle/product/10gas3/j2ee/home/applications/accaweb/accaweb/WEB-INF/libThe missing class is available from the following locations:     1. Code-Source: /oracle/app/oracle/product/10gas3/j2ee/home/default-web-app/WEB-INF/lib/jstl.jar (from WEB-INF/lib/ directory in /oracle/app/oracle/product/10gas3/j2ee/home/default-web-app/WEB-INF/lib)      This code-source is available in loader default.web.defaultWebApp:0.0.0.      at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2051) [oracle/app/oracle/product/10gas3/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@1482257]
    I have confirmed that the .war file inside the .ear file does contain the jstl.jar file under WEB-INF/lib folder. And the jar file does contain the class 'javax.servlet.jsp.jstl.core.Config'
    As a workaround, I found that if I copy the jstl.jar file from default-web-app to my application web-inf/lib folder, things start to work fine. ie copy from: '/oracle/app/oracle/product/10gas3/j2ee/home/default-web-app/WEB-INF/lib/jstl.jar'
    to: '/oracle/app/oracle/product/10gas3/j2ee/home/applications/accaweb/accaweb/WEB-INF/lib/'
    – or –
    Another workaround is to add the '/oracle/app/oracle/product/10gas3/j2ee/home/default-web-app/WEB-INF/lib/jstl.jar' file in the classpath for my web application through Application Server Control setting page.
    Now both of these workaround needs us to perform additional post deployment steps which should really not be required since the jar files is included in the project.
    Has anyone faced this issue? Any pointers in this respect will be a great help.
    regards - rutwik

    Surprise Surprise !
    I just tried deploying the file via uploading it from the Application Server Control UI and it worked fine.
    Till now, I was ftp'ing the ear file from my PC to the server on which Oracle AS is running and was telling Application Server Control to pick form that uploaded location.
    I am still not clear on why it works with HTTP upload and not via the FTP upload?
    cheers - rutwik

  • ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTagStatus

    In JSF2, writing facelets I tried to use <ui:repeat> tag instead of <c:forEach> - JSTL tag.
    I get -> java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTagStatus
    Here is my facelet snippet ...
    <ui:repeat value="#{historyCenterManagedBean.purchases}" var="order" >
             <tr>
                 <td>
                    #{order.totalPriceBeforeDiscounts}:
                 </td>
                 <td>
                    #{order.person.firstname}
                  </td>           
             </tr>
        </ui:repeat>I am not sure why am I getting it. Any help is appreciated.

    Hmm, Thanks Ryan. I am still confused.
    I am not clearly understanding why would c:forEach fail? And this is happening after the nightly build jar of 20091216
    for example this is we have:
    <c:forEach var="partner" items="#{contentPartnersManagedBean.allAuthorizedContentPartners}" >
        <tr>
              <td><a href="#{contextPathManagedBean.contextPath}/about_us/providers_detail.jsf?pID=${partner.partnerId}"
                     class="# {portalSkinManagedBean.contentPortletSkin.normalTextStyle}">${partner.partnerName}
                     </a>
              </td>
       </tr>
    </c:forEach>This is the exception:
    javax.servlet.ServletException: javax/servlet/jsp/jstl/core/LoopTagStatus
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.legaledcenter.util.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:250)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.jscape.framework.galileo.support.upload.UploadFilter.doFilter(UploadFilter.java:71)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.faces.view.facelets.FaceletException: javax/servlet/jsp/jstl/core/LoopTagStatus
         at com.sun.faces.facelets.tag.AbstractTagLibrary$UserComponentHandlerFactory.createHandler(AbstractTagLibrary.java:303)
         at com.sun.faces.facelets.tag.AbstractTagLibrary.createTagHandler(AbstractTagLibrary.java:672)
         at com.sun.faces.facelets.tag.CompositeTagLibrary.createTagHandler(CompositeTagLibrary.java:177)
         at com.sun.faces.facelets.compiler.TagUnit.createFaceletHandler(TagUnit.java:113)
         at com.sun.faces.facelets.compiler.CompilationUnit.getNextFaceletHandler(CompilationUnit.java:108)Thanks for responding.

  • ClassCastException: javax.servlet.jsp.jstl.fmt.LocalizationContext

    today i had the following exception, which blows my mind away. what can be wrong?
    java.lang.ClassCastException: javax.servlet.jsp.jstl.fmt.LocalizationContext
         at org.apache.taglibs.standard.tag.common.fmt.BundleSupport.getLocalizationContext(Ljavax.servlet.jsp.PageContext;)Ljavax.servlet.jsp.jstl.fmt.LocalizationContext;(BundleSupport.java:127)
         at org.apache.taglibs.standard.tag.common.fmt.MessageSupport.doEndTag()I(MessageSupport.java:152)
         at jsp_servlet._web_45_inf._jsp._templates.__template._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__template.java:235)environment: weblogic 8.1-sp4, jstl 1.0.6

    well the fact is that the JSPs are 100% correct. i'm migrating some legacy project, which builds, deploys and runs in its old state with no errors at all (and the old state is current PRO, so every bit of code is supposed to be correct). hence i presume it's not the JSPs that are wrong (because i never touched them), that's something else, probably the configuration of things, or conflicts between container libs and webapp libs, or sort of like that.
    so if this error doesn't ring a bell, then i'll try to fiddle around, i thought maybe that's something "famous" :).

  • JSTL javax.servlet.jsp.jstl.core.Config strange lookup

    Hi everyone !
    Could someone explain me this code in the class javax.servlet.jsp.jstl.core.Config :
    public static Object get(PageContext pc, String name, int scope) {
    switch (scope) {
         case PageContext.PAGE_SCOPE:
         return pc.getAttribute(name + PAGE_SCOPE_SUFFIX, scope);
         case PageContext.REQUEST_SCOPE:
         return pc.getAttribute(name + REQUEST_SCOPE_SUFFIX, scope);
         case PageContext.SESSION_SCOPE:
         return get(pc.getSession(), name);
         case PageContext.APPLICATION_SCOPE:
         return pc.getAttribute(name + APPLICATION_SCOPE_SUFFIX, scope);
         default:
         throw new IllegalArgumentException("unknown scope");
    Why adding a suffix when calling PageContext.getAttribute(String, int) ?
    This could lead to potential problems... For example, in my web application I want to share a single ResourceBundle for each JSP page and I would like to use <fmt:message/> tag to resolve my messages.
    For this purpose I added a LocalizationContext in my servlet context attribute in its init method:
    ResourceBundle bundle = ....
    LocalizationContext context = new LocalizationContext(bundle);
    servletContext.setAttribute(Config.FMT_LOCALIZATION_CONTEXT, context);
    Thus, the <fmt:message/> will be able to resolve the messages from this LocalizationContext...
    Unfortunately, this will never happen because the implementation of this tag call somewhere Config.find(PageContext, String) that will call the Config.get(PageContext, String, int) method....
    A quick fix would be to replace the name of the servlet context attribute :
    servletContext.setAttribute(Config.FMT_LOCALIZATION_CONTEXT + ".application", context);
    Could someone tell me if it is a bug ? A bug of the Message tag implementation ? A bug in JSTL code ? Or am I doing all wrong ?
    Note : I'am using a servlet 2.4/JSP 2.0 compatible application with the jstl 1.2 core library and the jakarta standard 1.1.2 implementation library. I'am using Jetty to test my application with Jasper as the JSP compiler...

    This is an internal decision made by JSTL as to how it stores its configuration values.
    The reason they have given here for the suffixes being added is to treat the four scopes as different namespaces, so that there can be no confusion between them.
    I'd say your mistake is trying to set this value into the attribute space yourself rather than using one of the defined interfaces for JSTL to do it - in web.xml, or using the Config class.
    I guess that would make your code
    Config.set(servletContext, Config.FMT_LOCALIZATION_CONTEXT, context); Using their interface for setting this attribute adds the required suffix automatically.
    Cheers,
    evnafets

  • Javax.servlet.jsp.jstl.sql.Result and arraylist

    Hi,
    I try to explain my problem, I have posted in another section of forum, but perhaps this is a better place:
    I'm trying to use MVC model, so I call an EJB from a servlet which returns me a javax.servlet.jsp.jstl.sql.Result object (this derive from a resultset of a query) and then I make this available to a jsp page.
    I've choosen to return an javax.servlet.jsp.jstl.sql.Result object because I'd like to use this syntax:
    <c:forEach var="profiloString" items="${listaProfili}" >
              ${profiloString.anything}
    </c:forEach>Now I need to put my listaProfili object in session and permit users of my application to add and delete items from it. Finally I will update my database with the new data from listaProfili object.
    If listaProfili is an arraylist I can easily add or delete item from it, but if it is a javax.servlet.jsp.jstl.sql.Result I don't know how I can do this.
    If I return an arraylist object instead of an javax.servlet.jsp.jstl.sql.Result object, I can't use "<c:forEach ..." syntax.
    Can anyone help me?
    Thanks.

    So why didn't you think that the JSP forum here wasn't a good place to ask JSP questions like this one?
    You can use <c:for-each> with a List. That's how it's designed. I don't understand why you say you can't. Perhaps you were confused by the SQL tags in JSTL. But anyway, you should just return a List from your EJB and forget about using obscure internal JSP classes.

  • "javax.servlet.jsp.JspException: null" When trying to use JSTL

    Hello,
    I am trying to use some taglibs from Apache but I am getting the following error when trying to access the relevant page:
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: null
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: null
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         org.apache.jsp.Questions_jsp._jspService(Questions_jsp.java:42)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.WEB_002dINF.EL_005f2_jsp._jspService(EL_005f2_jsp.java:171)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         org.apache.jsp.Questions_jsp._jspService(Questions_jsp.java:42)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.reflect.InvocationTargetException
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(Unknown Source)
         org.apache.jsp.WEB_002dINF.EL_005f2_jsp._jspx_meth_c_set_0(EL_005f2_jsp.java:208)
         org.apache.jsp.WEB_002dINF.EL_005f2_jsp._jspService(EL_005f2_jsp.java:113)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         org.apache.jsp.Questions_jsp._jspService(Questions_jsp.java:42)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)My web.xml file is as follows:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
    version="2.4">
    <display-name>Jsp_Ex09 - JSP Standard Tag Library</display-name>
    <welcome-file-list>
    <welcome-file>welcome.jsp</welcome-file>
    </welcome-file-list>
    <jsp-config>
    <taglib>
    <taglib-uri>/simplequestions</taglib-uri>
    <taglib-location>/WEB-INF/tlds/simplefaq.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
    </taglib>
    <jsp-property-group>
    <url-pattern>*.jsp</url-pattern>
    <el-ignored>false</el-ignored>
    <scripting-invalid>true</scripting-invalid>
    </jsp-property-group>
    </jsp-config>
    </web-app>I have the standard and jstl jars in my lib directory and the relevant tlds files int the tlds directory. I am using Tomcat 5.5 and J2EE 5.
    The jsp in question is as follows:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
    <html>
    <head>
    <title>JSTL Q2</title>
    </head>
    <body>
    <h1>JSTL Question 2</h1>
    <h2>How do I use the JSTL?</h2>
    <jsp:useBean id="questions" class="com.apress.faq.Questions"
    scope="page">
    <jsp:setProperty name="questions" property="topic" value="EL"/>
    </jsp:useBean>
    <table border="1">
    <!-- the literal JSTL tag will be in left column of table -->
    <!-- the evaluated JSTL tag will be in right column of table -->
    <tr><th>tag</th><th>result</th></tr>
    <!-- this tag uses c:out to send the value of an EL to the response -->
    <tr><td><c:out value="${'${'}questions.topic}"/></td>
    <td><c:out value="${questions.topic}"/></td>
    </tr>
    <!-- this tag uses c:set to set the property of a JavaBean -->
    <c:set target="${questions}" property="topic" value="JSTL" />
    <tr>
    <td><c:set target="${'${'}questions}" property="topic"
    value="JSTL"/>
    </td>
    <td><c:out value="${questions.topic}"/></td>
    </tr>
    <!-- this tag uses c:if to determine whether to create another row -->
    <c:if test="${questions.topic == 'EL'}">
    <tr><td>This row will not be created</td>
    <td></td>
    </tr>
    </c:if>
    <c:if test="${questions.topic == 'JSTL'}">
    <tr><td>This row was created because the c:if tag result was true</td>
    <td></td>
    </tr>
    </c:if>
    </table>
    <h2>Multiplication table, 1 - 5</h2>
    <!-use the forEach tag to create a table -->
    <table border="1">
    <tr><td></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td></tr>
    <c:forEach var="i" begin="1" end="5">
    <tr><td><c:out value="${i}"/></td>
    <c:forEach var="j" begin="1" end="5">
    <td><c:out value="${i*j}"/></td>
    </c:forEach>
    </tr>
    </c:forEach>
    </table>
    <h2>Formatting numbers</h2
    <br><fmt:formatNumber value="23.456" type="number" /> results in
    <fmt:formatNumber value="23.456" type="number" />
    <br><fmt:formatNumber type="currency">23.456
    </fmt:formatNumber> results in <fmt:formatNumber
    type="currency">23.456</fmt:formatNumber>
    <br><fmt:formatNumber value=".23456" type="percent"/> results
    in <fmt:formatNumber value=".23456" type="percent"/>
    <br><fmt:formatNumber value=".23456" type="percent"
    minFractionDigits="2"/> results in <fmt:formatNumber
    value=".23456" type="percent" minFractionDigits="2"/>
    </body>
    </html>Can anyone spot the problem?
    Sorry for such a big post!

    ava.lang.reflect.InvocationTargetException
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(Unknown Source)From the stacktrace, it appears to be from a <c:set> tag.
    Invocation target exception would meant that an error was encountered calling the setter.
    That would focus on this part of the code:
    <!-- this tag uses c:set to set the property of a JavaBean -->
    <c:set target="${questions}" property="topic" value="JSTL" />
    <tr>
    <td><c:set target="${'${'}questions}" property="topic"
    value="JSTL"/>
    </td>That nesting of ${ } inside ${} looks dodgy to me. What is it you are trying to achieve?

  • Should I use JSP,JSTL,SERVLETs without a framework?

    Hi Guys
    I'm making a multi player browser game. The game will have some forms to setup data into the database and the player will be able to check other players data.
    I will load the players data from the DB into a Bean when the application starts and then just get the other players information from DB when and if asked.
    I'm planing on doing it as MVC2 using JSP, JSTL, SERVLETs, BEANs
    Would you recommend me to use Struts for example? should I just use it without any framework?
    I read a lot about Struts and can't really see what it can bring to an application like mine. I can use the i18n easily with JSTL and for few validation of forms I don't know if it's worth it.
    What do you think? (-:
    Thanks in advance
    (-:

    If your going to use MVC2 then I would use a framework, otherwise where are you going to get your MVC from, were you planning on writing an MVC yourself?

  • Good books for learning Java(Servlets,JSP,EJB,etc.,),Javascript.

    Hi Experts,
    Can you suggest me some good books on java , javascript.The books should include the internals of Servlets,JSP,EJB.
    Thanks
    vishal

    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=756427&start=7
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=751055
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=743429
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=742997&start=11
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=750775&start=24
    Just a simple search for this forum....
    It took me 10 seconds tofind these..
    JJ

  • Servlet/JSP question

    Hello guys I have just been reading the HeadFirst Servlet/JSP book from O'REILLY.
    I have used it as a workbook just to see how the framework are use. After ending this book I have planned to do some stuff by my self. I'm precisely in the last chapters of the book right now so I thought about headed toward the Servlet/JSP API. Well in there I found out that the information about JSP were all just about stuff which concerned the Container. I didn't find anything about the syntax used in JSP, the EL syntax nor how the JSTL 1.1 tags looks like! And there where nothing about the DD.
    So I'm wondering were I could fins this information, and why they aren't reserved in the JSP API?
    Another question, when was the JSP2.0/Servlet2.4 specification released?

    Which edition of the book were you reading? It should have covered EL and JSP syntax right?
    Servlet2.4/JSP2.0 has been around for at least 5 years. Can't remember the exact date, but the specification was finalised November 2003.
    The JSP API is from the programming perspective. Tag library documentation is seperate.
    Useful links for you:
    [JSP reference |http://java.sun.com/products/jsp/docs.html] - JSP tags and EL.
    [JSTL Apis|http://java.sun.com/products/jsp/jstl/reference/api/index.html] THE reference for JSTL. Don't be afraid of the JSTL specifications. They are quite readable, and document all the JSTL tags fully. I refer to them constantly.
    Cheers,
    evnafets

  • JSP, JSTL and XML Exception

    Hi,
    I'm using tomcat 5.0.28 with J2SE5, JSP and JSTL. I tried to execute the following example about JSTL and XML.
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
    <c:import url="book.xml" var="url" />
    <x:parse xml="${url}" var="book" scope="session" />
    <x:choose>
    </x:choose>
    <P>
    <B><x:out select="$book/book/title"/></B><BR>
    <x:out select="$book/book/author"/><BR>
    <x:out select="$book/book/url"/><BR>When I execute the jsp file, the container produces following exception:
    javax.servlet.ServletException: org/apache/xpath/XPathException
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:104)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
         java.lang.ClassLoader.defineClass1(Native Method)
         java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         org.apache.taglibs.standard.tag.common.xml.WhenTag.condition(WhenTag.java:51)
         org.apache.taglibs.standard.tag.common.core.WhenTagSupport.doStartTag(WhenTagSupport.java:65)
         org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_when_0(xml_005fchoose_jsp.java:203)
         org.apache.jsp.xml.xml_005fchoose_jsp._jspx_meth_x_choose_0(xml_005fchoose_jsp.java:169)
         org.apache.jsp.xml.xml_005fchoose_jsp._jspService(xml_005fchoose_jsp.java:84)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Due to the fact, that org/apache/xpath/XPathException belongs to xalan, i copied the xalan 2.7.0 to the web-inf/lib directory. But this doesn't solve the problem. I'm tried it also with xalan, xerces and jaxp. Again, it doesn't work.
    Can anybody help me with this problem?
    bye

    Couple of things, possibly unrelated, but not sure.
    You are using JSTL1.0 uris.
    With Tomcat5 you can use JSTL1.1, and the Servlet2.4 spec.
    You would use the URI: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    and also update your web.xml file to declare itself as version 2.4
    You shouldn't need any of the xalan xerces or jaxp classes in web-inf/lib.
    xerces is by default found in the [TOMCAT]/common/endorsed directory.
    The others should be provided with the standard java API.
    I would try with minimal jar files in web-inf/lib
    Occasionally if you include files twice in the classpath it will create ClassNotFoundExceptions like this.
    Hope this helps,
    evnafets

  • Problem: package javax.servlet.jsp does not exist

    I am a novice JSP programmer. My projects that use any javax.servlet classes are not seeing those at all. I am working with a group of folks using Java SE 1.5. (Note: I'm using Windows so the directory separator is "\")
    What Used to work:
    1. Nearly all my projects were working using Java version 1.6. These projects were developed as examples from Wrox and Apress books about JSP and Struts.
    What has changed:
    1. I un-installed the version 1.6 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
    2. I installed version 1.5 of JDK and JRE, as well as tomcat, netbeans, and all the associated libraries/jars.
    3. I updated my JAVA_HOME, CATALINA_HOME, CLASSPATH, and PATH environmental variables. I made sure that the path to servlet-api.jar (in the tomcat common\lib) is included in the classpath.
    What is wrong:
    1. References to javax.servlet.* are not satisfied--they are flagged in the source code in NetBeans and I get compiler errors with any project containing those references. For example:
    ... package javax.servlet.jsp does not exist
    import javax.servlet.jsp.*;
    What I've found:
    1. My CATALINA_HOME=C:\Java\Tomcat 5.5
    2. My JAVA_HOME=C:\Java\jdk1.5.0_11
    3. My CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib;%JAVA_HOME%\lib\jsp-api.jar;%CATALINA_HOME%\common\lib\servlet-api.jar;C:\Java\logging-log4j-1.2.14\dist\lib\log4j-1.2.14.jar
    4. My PATH=c:\wint\BIN;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%CATALINA_HOME%\bin;C:\MySQL\MySQL Server 5.0\bin;D:\MiKTeX 2.5\miktex\bin;C:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\SFU\Perl\bin\;C:\SFU\common\;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Bin;C:\Program Files\Lahey-Fujitsu Fortran\v7.1\Win32\Bin
    What I need:
    1. I need to have some reference to the servlet classes satisfied in my configuration. Any help is appreciated.
    thanks
    jondr

    Oh. I got some over-the-shoulder debug help.
    My error was in the classpath specification:
    The path: %JAVA_HOME%\lib\jsp-api.jar
    Should be: %CATALINA_HOME%\lib\jsp-api.jar
    That contains the javax.servlet.jsp.*
    Thimk.
    Message was edited by: jon
    jondr

  • Javax.servlet.jsp.JspException: Cannot find FacesContext

    Hello All,
    I was trying to create a simple JSF page (Welcome.jspx )(please find code bellow) .But it is always giving the following error:
    javax.servlet.jsp.JspException: Cannot find FacesContext
    The error appears though i am calling the page with the faces servlet (http://128.128.5.64:8989/GradeEntry/faces/Infrastructure/Welcome.jspx)!!
    I have searched all possible forums on the Internet and tried their suggestions with no luck...My web.xml configuration contains the right Faces Servlet Mapping :
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    Bear in mind that i can run from the project pages that are generated from Oracle Jheadstart...But i just can't run this welcome page that i've created with JDeveloper.
    Please find bellow the code for Welcome.jspx:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
    <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
    doctype-system="http://www.w3.org/TR/html4/loose.dtd"
    doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>tt</title>
    </head>
    <body><h:form></h:form></body>
    </html>
    </f:view>
    </jsp:root>
    You help is very appreciated!!

    Hi,
    actually this mapping only identifies those requests to be handled by teh JSF servlet. Its not a redirect.
    I see several namespace definitions in your page, but no taglib reference. Wondering how this is supposed to work
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    I assume the next crash you will see is when you add JSF components to
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>tt</title>
    </head>
    <body><h:form></h:form></body>
    </html>
    </f:view>
    Note that mixing HTML elements with JSF is not a recommended approach
    Frank

Maybe you are looking for

  • Employee group have been wrongly assigned during Hiring in PA40

    Dear Guru, I have one scenario where an employee; employee group have been wrongly assigned during Hiring PA40. The user has entered and assigned the employee group as Contract - Local instead of Contract - Foreigner in the Employee group field. Plea

  • Lag with external display macbook pro 13" i5!

    Hello everyone! I just bought a brand new 13" macbook pro i5, it works absolutely fantastic. There's only one thing i'm not happy about:  If I connect an external monitor to it (both my sharp32" via hdmi and my 19" samsung via VGA) it starts to lag!

  • How to open photos as a list?

    Hello, I've always been annoyed at iPhoto's inability to resize images – especially since Preview can. So I made a droplet to resize images for me (see end) and set it as my external editor. Unfortunately, if I try to open multiple images from iPhoto

  • Cross-tab - Repeat Row Name

    How can I get the Row Names in a cross-tab to repeat on every record? This would be useful for users that export the report to Excel and want to use column filters.

  • I find it difficult to download OS X mavericks..it  is getting stuck in between

    downloading OS X MAVERICKS is becomin frustrating...it is stopping in betweeen