JSF and Servlet Interaction

Hello All,
I have a question if some one can kindly give his/her expert opinion.
1) Can we call a Servlet from a JSF Page the same way as calling it from an HTML or JSP Page?
2) If the answer to the above question is "Yes", how can a JSF page get the data from the response generated by a Servlet (In a JSP page, we can get the data from the Session object ).
Waiting for a favorable reply.
Kind Regards.
Hasnain Javed Khan.

As far as I know JSF are servlets the same way JSP are, so it would work the same way. They bothe extend javax.servlet.Servlet, thus all the mothods belonging to the Sevlet class would be available to the etending classes in this case your JSF pages.
http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/index.html
MeTitus

Similar Messages

  • Jsf (java server faces) and servlets

    Hi,
    Could anyone tell me if it is possible to integrate jsf with servlets rather than jsp. All the examples i see are only using jsp.
    Thanks.

    I'm using servlets because they are more secure. No
    one can view the source code on the web server, as it
    is a class file. With jsp's the code is always
    viewable. Can you explain how the code is viewable? If a client gets a JSP result down in their browser and does a "View Source", all they'll see is the generated HTML. Are you thinking they'll see your raw JSP? Not so.
    JSPs are compiled to servlets. By the time your clients get to them they're no different from servlets.
    You might be asking how you can restrict access to the raw JSP source. If you put it under WEB-INF/classes there's no way for an external client to get at it.
    %

  • Use of filter to JSF faces servlet

    Hi
    I have a JSF application which is secured by a custom security framework (similar to SITE MINDER). The security framework after authentication passes the authenticated user name within a in-memory session cookie.
    The entire user information like his group and access restrictions (field / UI compoonent level) resides in the application database
    I have used a filter to JSF Faces servlet to retrieve the user information from the database and storing in session.
    Is this use of filter a good approach?

    I would fetch such information only once and store it in a simple session scoped bean after a successful login, but I am weird for wanting to do things in a simple way.
    A filter can work to validate if the user is still "logged in" (IE. his/her session didn't expire), but since this is JSF you could also use a phase listener for such a purpose.

  • Using JSF and IFRAMEs

    I have a basic JSF app that takes some input, does a request and creates a table on output. What I need to do with it now is to have the query "page" and results "page" in two iframes on the same page. Before the query has been run the second iframe should just be blank (or with some default text). After the query that frame should be populated but the query frame needs to still be there. I've managed to do part of this. The "search" page and the "results" page are in separate iframes:
    <%@ page session="true" %>
    <html>
    <head>
      <title>Frames</title>
    </head>
    <body>
    <table>
      <tr>
        <td width="100%" colspan="2">
          <iframe title="Synonyms Search" src="search.jsf"
              width="800" height="200">
          Alternate search content...
          </iframe>
         </td>
      </tr>
      <tr>
      <td width="100%">
        <iframe src="results.jsp" title="Results"
          width="800" height="800">
          Results....
        </iframe>
      </td>
      </tr>
    </table>
    </body>
    </html>The reason this page is not using jsf tags is that the iframes will need to contain other pages that themselves are not jsf (mostly servlets) and I wasn't sure I could make that work. Currently the problem is that previously the search page had a QueryBean that the results page accessed to create it's table of results. Now in iframes the results.jsp frame just has a jsp processing exception and running the query does nothing. I'm new to JSF so I'm sure there's parts I'm missing, these do work if I pull them outside the frames and write navigation rules in the faces-context.xml file.
    Thanks,
    Sarah

    nigeldeakin wrote:
    The first thing to ask is whether you are sure that
         @Resource(name = "jms/QueueConnectionFactory",mappedName = "queueConnectionFactory")
         private ConnectionFactory connectionFactory;is valid. Does it work when you use it in other places?No it is not working still giving me NullPointerException for it. I'm using JBoss AS and having hard times deploying a jms queue on it i used an xml file to configure the queue and here is the file
    <?xml version="1.0" encoding="UTF-8"?>
    <server>
         <mbean code="org.jboss.jms.server.destination.QueueService"
              name="jboss.messaging.destination:service=Queue,name=StockHistoryQueue"
              xmbean-dd="xmdesc/Queue-xmbean.xml">
              <depends optional-attribute-name="ServerPeer">
                   jboss.messaging:service=ServerPeer
             </depends>
              <depends>jboss.messaging:service=PostOffice</depends>
         </mbean>
    </server>i think it's not working because i have this null exception for queue factory.

  • JSF and Character Sets (UTF-8)

    Hi all,
    This question might have been asked before, but I'm going to ask it anyway because I'm completely puzzled by how this works in JSF.
    Let's begin with the basics, I have an application running on an OC4J servlet container, and am using JSF 1.1 (MyFaces). The problems I am having with this setup, is that it seems that the character encodings I want the server/client to use are not coming across correctly. I'm trying to enforce the application to be UTF-8, but after the response is rendered to my client, I've magically been reverted to ISO-8859-1, which is the main character set for the netherlands. However, I'm building the application to support proper internationalization; which means I NEED to use UTF-8.
    I've executed the following steps to reach this goal:
    - All JSP files contain page directives, noting the character set:
    <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>I've checked the generated source that comes from the JSP's, it looks as expected.
    - I've created a servlet filter to set the character set directly on the request and response objects:
        public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
            // Set the characterencoding for the request and response streams.
            req.setCharacterEncoding("UTF-8");
            res.setContentType("text/html; charset=UTF-8");       
            // Complete (continue) the processing chain.
            chain.doFilter(req, res); 
        }I've debugged the code, and this works fine, except for where JSF comes in. If I use the above situation, without going through JSF, my pages come back UTF-8. When I go through JSF, my pages come back as ISO-8859-1. I'm baffled as to what is causing this. On several forums, writing a filter was proposed as the solution, however this doesn't do it for me.
    It looks like somewhere internally in JSF the character set is changed to ISO. I've been through the sources, and I've found several pieces of code that support that theory. I've seen portions of code where the character set for the response is set to that of the request. Which in my case coming from a dutch system, will be ISO.
    How can this be prevented? Can anyone give some good insight on the inner workings of JSF with regards to character sets in specific? Could this be a servlet container problem?
    Many thanks in advance for your assistance,
    Jarno

    Jarno,
    I've been investigating JSF and character encodings a bit this weekend. And I have to say it's more than a little confusing. But I may have a little insight as to what's going on here.
    I have a post here:
    http://forum.java.sun.com/thread.jspa?threadID=725929&tstart=45
    where I have a number of open questions regarding JSF 1.2's intended handling of character encodings. Please feel free to comment, as you're clearly struggling with some of the same questions I have.
    In MyFaces JSF 1.1 and JSF-RI 1.2 the handling appears to be dependent on the raw Content-Type header. Looking at the MyFaces implementation here -
    http://svn.apache.org/repos/asf/myfaces/legacy/tags/JSF_1_1_started/src/myfaces/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
    (which I'm not sure is the correct code, but it's the best I've found) it looks like the raw header Content-Type header is being parsed in handleCharacterEncoding. The resulting value (if not null) is used to set the request character encoding.
    The JSF-RI 1.2 code is similar - calculateCharacterEncoding(FacesContext) in ViewHandler appears to parse the raw header, as opposed to using the CharacterEncoding getter on ServletRequest. This is understandable, as this code should be able to handle PortletRequests as well as ServletRequests. And PortletRequests don't have set/getCharacterEncoding methods.
    My first thought is that calling setCharacterEncoding on the request in the filter may not update the raw Content-Type header. (I haven't checked if this is the case) If it doesn't, then the raw header may be getting reparsed and the request encoding getting reset in the ViewHandler. I'd suggest that you check the state of the Content-Type header before and after your call to req.setCharacterEncoding('UTF-8"). If the header charset value is unset or unchanged after this call, you may want to update it manually in your Filter.
    If that doesn't work, I'd suggest writing a simple ViewHandler which prints out the request's character encoding and the value of the Content-Type header to your logs before and after the calls to the underlying ViewHandler for each major method (i.e. renderView, etc.)
    Not sure if that's helpful, but it's my best advice based on the understanding I've reached to date. And I definitely agree - documentation on this point appears to be lacking. Good luck
    Regards,
    Peter

  • *** Example of JSF Image servlet that can write image to network drive ??

    Hi Guys,
    Does anyone have an example of a of JSF Image servlet that can Write image to network drive ??
    I can write an image to my local drive on my tomcat app server. But when I try to map to a network drive with IP or Mapped drive it fails.
    Any help out there ??
    Thanks
    Phil

    Hi,
    The drive I am trying to access is on a box 45.65.111.115 ip
    I have mapped the box and drive to M:
    Setting sharing on...
    I have tried a few new ways...
    imageDrive2=M:\\test_images\\
    gives this errror
                java.io.FileNotFoundException: M:\test_images\first250k\16Sep0857_Phil_Tucson.JPG (The system cannot find the path specified)
         at java.io.RandomAccessFile.open(Native Method)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
         at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:44)=============================================
    imageDrive3=\\\\45.65.111.115\\first250k\\test3.jpg
    gives this errror
    java.io.FileNotFoundException: \\45.65.111.115\first250k\test3.jpg (Access is denied)
         at java.io.RandomAccessFile.open(Native Method)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
         at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:44)
         at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:37)========================================================
    imageDrive4=\\\\45.73.111.115\\test_images\\test4.jpg
    gives this errror
    java.io.FileNotFoundException: \\45.73.111.115\test_images\test4.jpg (Access is denied)
         at java.io.RandomAccessFile.open(Native Method)
         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
         at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:44)
         at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:37)
         at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:391)
         at javax.imageio.ImageIO.write(ImageIO.java:1483)=============================================================================
    Any help out there??
    Phil

  • Midlet-Servlet interaction

    Hi there,
    Could someone please help with a problem I am having when running a MIDlet on the POSE Emulator.I am trying to run a Midlet which calls a servlet to find the number of hits .I do not have any compilation errors.I am using J2me ToolKit 1.0.4.When I run the Midlet on the Emulator, I am able to reach only upto the point where I can select the program on the POSE Emulator.On selecting the application, I get an error : Uncaught Exception-java.lang.IllegalArgumentException.Please give some suggestions as to the cause of this error.I have been trying the J2me Tutorial Part II-Midlet Servlet Interaction(Sun).
    Thanks in advance

    Hi,
    this exception means that you are trying to pass some variable data to a method and the data is not compatible with those in methods signature, e.g.
    somemethod(java.util.Properties) and you call the method with somemethod(myData) where my data is corrupt or not a descendant of the HashTable or Properties object. If you post the code I will be able to help you better.
    Regs jP

  • Jsf and Seam

    Hi,
    I have a JSF project and would like to add a Captcha on the new user page.
    I see several examples with Seam.
    http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/captcha-with-seam-in-three-minutes.html
    http://thelabdude.blogspot.com/2009/05/user-registration-solution-using-jboss.html
    1) What do I need to add Seam to my app? Is it worth it from Captcha?
    http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf?s=glassX
    I copied this into my app to test and get several errors. I did not see the problem?
    I see a NullPointer error..but dont know where to set it.
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Error send image
            at org.richfaces.renderkit.html.Paint2DResource.send(Paint2DResource.java:192)
            at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
            at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:146)
            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:225)
            at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
            at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:496)
            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:175)
            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:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Unknown Source)
    Caused by: javax.faces.el.EvaluationException: org.apache.jasper.el.JspELException: /loginTest.jsp(62,2) '#{paintBean.paint}' java.lang.NullPointerException
            at org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor.invoke(MethodBindingMethodExpressionAdaptor.java:56)
            at org.richfaces.renderkit.html.Paint2DResource.send(Paint2DResource.java:182)
            ... 17 more
    Caused by: org.apache.jasper.el.JspELException: /loginTest.jsp(62,2) '#{paintBean.paint}' java.lang.NullPointerException
            at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:77)
            at org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor.invoke(MethodBindingMethodExpressionAdaptor.java:52)
            ... 18 more
    Caused by: java.lang.NullPointerException
            at com.netfixup.java.PaintBean.paint(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)Anyone out there have and easy quick way to do Captcha with just JSF ? or should I go with Seam?
    Thanks
    Phil
    Edited by: nohacks on Aug 20, 2009 4:08 AM

    Going to seam might not be the answer to your problems. For one seam is not easy to get running on anything but a JBoss server (it is possible, but not easy). Secondly Seam is aimed at bringing JSF and EJBs closer together, among other things. Since you are running on Tomcat, I don't think you are using EJBs and therefore the use of Seam degrades greatly.
    The root of the problem is easy enough to spot:
    /loginTest.jsp(62,2) '#{paintBean.paint}'So what is this paintBean doing? If you have access to the code, you could check out the method that gives the error:
    com.netfixup.java.PaintBean.paintto try and figure out what is null. SOMETHING is apparently not initialized properly, but unless the server logs can give you a hint what that something is, it is hard to help you further.

  • JSF and Facelets on OC4J 10.1.2 / 10.1.3_dp4

    Hi,
    I am developing a web application using JSF and it works properly on OPC4J (JSF RI and myFaces). But I cannot find a way to get Facelets running.
    When I simply deploy the sample application from exadel here I get strange errors:
    1) Using JSP 2.4
    java.io.IOException: code-source:/D:/dev/Server/oc4j_10.1.3_dp4/j2ee/home/applications/JSF/JSF63622/WEB-INF/lib/xhtml-lat1.ent has no "!<path>" suffix so does not name a path within the code-source.
         at oracle.oc4j.loader.SharedCodeSourceSet.getResourceStream(SharedCodeSourceSet.java:396)
         at oracle.oc4j.loader.SharedCodeSourceURL$Connection.getInputStream(SharedCodeSourceURL.java:93)
         at java.net.URL.openStream(URL.java:1007)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2367)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:280)
         at oracle.xml.parser.v2.XMLReader.pushEntityRef(XMLReader.java:2240)
         at oracle.xml.parser.v2.XMLReader.pushEntityRef(XMLReader.java:2168)
         at oracle.xml.parser.v2.XMLExternalReader.pushEntityRef(XMLExternalReader.java:157)
         at oracle.xml.parser.v2.XMLExternalReader.checkEntityStart(XMLExternalReader.java:167)
         at oracle.xml.parser.v2.XMLExternalReader.setMarkupDepth(XMLExternalReader.java:285)
         at oracle.xml.parser.v2.NonValidatingParser.parseMarkupDecl(NonValidatingParser.java:617)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:484)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:310)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:289)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:199)
         at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:292)
         at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:230)
         at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:219)
         at com.sun.facelets.compiler.Compiler.compile(Compiler.java:99)
         at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:187)
         at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:137)
         at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:88)
         at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:396)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:434)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:291)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:48)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:225)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:173)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:305)
         at index2e_jsp._jspService(_index_2e_jsp.java:46)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:408)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:525)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:447)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:833)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:430)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:215)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    2) Using JSP 2.4:
    java.lang.NullPointerException
         at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
         at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:76)
         at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:398)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:432)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:291)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:48)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:225)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:173)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:230)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:305)
         at index2e_jsp._jspService(_index_2e_jsp.java:46)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:644)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:364)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:525)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:447)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:382)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:701)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:397)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:833)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:430)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:215)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Has anyone some tips for me why Facelets does not work or how i can get it to work?
    Thanks, Daniel

    Copy the META-INF folder of the
    jsf-facelets.jar to a folder called "config" in the WEB-INF folder of your web and add
    <context-param>
    <param-name>facelets.LIBRARIES</param-name>
    <param-value>/WEB-INF/config/jsf-core.taglib.xml;/WEB-INF/config/jsf-html.taglib.xml;/WEB-INF/config/jsf-ui.taglib.xml;/WEB-INF/config/jstl-core.taglib.xml;/WEB-INF/config/jstl-fn.taglib.xml</param-value>
    </context-param>
    to the web.xml.
    This helped for me.

  • Issue in using JSF and tiles

    Hai,
    I am using JSF and tiles in my application along with richfaces 3.2 jar but the suggestion box does not work when i use incorporate tiles to the jsp page,Please help me out.Here is my code
    Content Page
    <%@ taglib prefix= "f" uri="http://java.sun.com/jsf/core"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"  %>
    <%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f"  %>
    <%@ taglib uri="http://java.sun.com/jsf/html"   prefix="h"  %>
    <%@ taglib uri="http://jakarta.apache.org/tiles"  prefix="tiles"  %>
         <f:view >
             <link href="<%=request.getContextPath()%>\styles\Form.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Menu.css" rel="stylesheet" type="text/css"/>
             <link href="<%=request.getContextPath()%>\styles\Header.css" rel="stylesheet" type="text/css"/>
             <title><h:outputText value="Brand"/></title>
             <h:form id="testForm">
                 <tiles:insert definition="test_create" flush="false"/>
             </h:form>
         </f:view>JSP
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <f:subview id="come">
    <body>
    <h:form>
    <h:outputText value="Provider:" styleClass="SubTitle" />
    <h:inputText value="#{testMBean.property}" size="25" id="dpiSuggest" styleClass="SubTitle">
        <a4j:support event="onkeyup" />
    </h:inputText>   
    <rich:suggestionbox for="dpiSuggest" suggestionAction="#{testMBean.suggest}" height="180" width="180" var="suggest">
    <h:column>
    <h:outputText value="#{suggest.countryName}" />
    </h:column>
    <h:column>
    <h:outputText value="#{suggest.countryCode}" />
    </h:column>
    </rich:suggestionbox>
    </h:form>
    </body>
    </f:subview>
    </html>
    *tiles.xml*
    <tiles-definitions>
        <definition name="header-menu-content" path="/layout/basicLayout.jsp">
            <put name="gridClass"           value="headerMenuContent"/>  
            <put name="headerClass"         value="HeaderBgcolor"/>
            <put name="menuColumnClass"     value="MenuBorder"/>
            <put name="contentColumnClass"  value="BodyBgColor"/>
        </definition>
        <definition name="home" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/home.jsp"/>     
        </definition>
        <definition name="error" extends="header-menu-content">
            <put name="header"  value="/common/header.jsp"/>
            <put name="menu"    value="/common/menu.jsp"/>
            <!--<put name="buttonBar" value="/common/buttonBar.jsp"/>-->
            <put name="content" value="/common/error.jsp"/>     
        </definition>
            <definition  name="test_create" extends="header-menu-content">
                 <put name="header" value="/common/header.jsp" />
                 <put name="menu" value="/common/menu.jsp" />
                 <!-- <put name="buttonBar" value="/common/buttonBar.jsp"/>-->
                 <put name="content" value="/test.jsp" />
             </definition>
        <tiles-definitions>
    *web.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" 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 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>welcome.jsp</welcome-file>
            </welcome-file-list>
             <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
      </context-param>
      <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
      </context-param>
      <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>*.faces</url-pattern>
      </servlet-mapping>
    <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</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>Tiles Servlet</servlet-name>
          <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class>
          <init-param>
             <param-name>definitions-config</param-name>
             <param-value>/WEB-INF/tiles.xml</param-value>
          </init-param>
          <load-on-startup>2</load-on-startup>
       </servlet>
        </web-app>
    *facesconfig.xml*
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config version="1.2"
                  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 http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
        <navigation-rule>
                <navigation-case> <!-- Displayes the screen to add data -->
                <from-outcome>test</from-outcome>
                <to-view-id>/testContent.jsp</to-view-id>
                <redirect/>
            </navigation-case>
        </navigation-rule>
        <managed-bean>
            <managed-bean-name>testMBean</managed-bean-name>
            <managed-bean-class>testMBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
      </faces-config>Edited by: SreeramIyer on May 29, 2008 4:50 AM

    Are you dead set on using tiles? I can see tiles including JSF but JSF including tiles? Not sure if that will work.
    My suggestion is to use Trinidad. It has the concept of Regions which is very "tiles" like and you will be far more successful.

  • How to customize events, execute stored procedures using JSF and ADF BC

    As a java beginner, I started with developing simple web application using JSF and ADF business component through visual and declarative approach. I need to know how to customize events, execute stored procedures, invoke functions on triggering events associated with rich controls. for eg. how to write customized functions on button click or checkbox click events to achieve business requirement and can be modified whenever required.
    Edited by: 792068 on Aug 31, 2010 9:40 PM

    Which business layer is prefered to create interactive data model: 1. ADF business components or 2. Enterprise JavaBeans using Java persistance API (JPA) or 3. Toplink 4. Portlets
    which minimizes writing low level codes and how much OOPS knowledge is required for creating above business layer binding data to viewcontroller layer?

  • Jsf and richfaces version compatibility issue

    Hi,
    I am using JRE 1.5 , jsf 1.2 , richfaces 3.3.3 and deployed in Tomcat 6.0.18. I am getting following error.
    javax.servlet.ServletException: /allocator.xhtml @30,163 <rich:tree> Tag Library supports namespace: http://richfaces.org/rich, but no tag was defined for name: tree
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)
    root cause
    javax.faces.view.facelets.TagException: /allocator.xhtml @30,163 <rich:tree> Tag Library supports namespace: http://richfaces.org/rich, but no tag was defined for name: tree
         com.sun.faces.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:289)
         com.sun.faces.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:228)
         com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
         com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
         com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         com.sun.org.apache.xerces.internal.parsers.XML11Configuration
    Thanks,
    BPradhan

    In my development box , I can use any version of jre, tomcat.
    But, we have our department dev and prod server configured with jre 1.5 and tomcat 6.0.18
    Some other applications are running in those environment with jre 1.5 and tomcat 6.0.18. I cannot upgrade just for new application.
    when tomcat6 was downloaded in our department dev and prod server , they are installed with jre5. Subsequently servers are upgraded with jre6 but it seems like tomcat recognises jre5 not jre6. Let me know if i am wrong about jre version tomcat is trying to use.
    Also, can you help me with the environment I have and problems i am encountering with jsf and richfaces.
    Thanks,
    BPradhan
    Edited by: user618018 on Feb 1, 2013 5:03 PM

  • Interesting single sigon application project using jsp and servlet....Help.

    A customer login's to my website using Enterprise login. I am supposed to have a link on my website to this other website(that also uses our Enterprise login details but hosted by other vendor/company on their server), and when I click this link the customes should automatically get logged in to this other website and get a welcome page(instead of login page).
    Below are the sequence of steps that the other website wants me to perform to get to his welcome page(i.e bypass his login page).
    FYI, I am planning to build a jsp page with a link to this other website. Can some body tell me how should I build the application(i.e) how jsp and servlets be build to interact to perform these operations. Any hep is greatly appreciated.
    1.When a user clicks on to other website link(available on my website), the browser generates an HTTP GET request to the Other website's session servlet. User's name is one of the parameters of this request.
    2.Other website receives the HTTP request and generates a unique session identifier for this user. An HTTP response to the end-user is then sent. The user's name and the session identifier are passed back as parameters in the redirect URL.
    3.The browser sends the HTTP request (GET) to the Verification Service that was specified in the redirect message. The parameters (user name and/or session id) will be passed as URL parameters.
    4.The Verification Service(of other website) authenticates the user. A redirect URL to it's sigon servlet(with parameter's User id and key) is then sent back to the user's browser.
    5.The end-user's browser will perform the redirect (performing an HTTP get operation to Other website's signon servlet with the username and the digest key).
    6.The other website will check if the parameter's passed is the same as the one passed earlier, if the user is who he says he is then he is redirected to the main page of the application.
    7.The browser will then redirect the user to Other website's main page (welcome.jsp).
    There seems's to be many calls to this other website that needs to be performed behind the scenes once a user clicks the link on my website.
    Please suggest and help me out.........
    Edited by: 836726 on Feb 21, 2011 3:41 PM

    Why are you trying to build a whole federated single sign on framework from scratch when you can just use/buy an existing and proven solution instead? There are a lot of security implication and trust issues involved for this so unless you already understand all of those I'd advise you not to re-invent the wheel. There are a lot of products available that do this. Try searching for '<vendor name> Access Manager' or OpenSSO.

  • Need some help with Slow Downs in Java3D and Servlets

    Hi,
    I realize that there is a separate forum for Java 3D, but I posted there, and did not get any response. This is kinda the crux of my program, so I would like to invite anybody on this forum with knowledge of Java 3D and servlets to give it a stab. Between this post and that one, there are TWENTY duke dollars up for grabs.
    Thanks.
    http://forum.java.sun.com/thread.jspa?threadID=603198

    Let me have an educated guess.
    You calculated the time elapsed before sending in a server request - and at that point you have you updated timeLastStateChange yet, which means by the time of the next calculation of time elapsed this apparent delay is not counted in, hence the slow down in animation rate.
    Hope this helps~
    Alex Lam S.L.

  • Web service and servlets in the same project...web.xml?

    Hello, I have a problem with my web service.
    I have a server, which displays a web service. I programmed this service with JAXRPC.
    I have a client, in another directory. I succeded in compiling, deploying and running the web service.
    The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
    These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
    But of course, it's not working by itself. I know there's something to do with the web.xml files.
    The thing is that I created a web.xml file for the service, and another for the servlets.
    I was thinking of joining both of them in one xml file, but everything crashes then...
    Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
    Thanks for any help
    Philippe

    Hello, I have a problem with my web service.
    I have a server, which displays a web service. I programmed this service with JAXRPC.
    I have a client, in another directory. I succeded in compiling, deploying and running the web service.
    The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
    These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
    But of course, it's not working by itself. I know there's something to do with the web.xml files.
    The thing is that I created a web.xml file for the service, and another for the servlets.
    I was thinking of joining both of them in one xml file, but everything crashes then...
    Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
    Thanks for any help
    Philippe

Maybe you are looking for