How to pre-compile JSF pages?

Hi,
I am new to JSF and would appriciate if any one can help me find out how to pre-compile JSF pages?
Thanks in advance
satsdn

The same way you pre-compile JSP pages: Set it up in your faces-config.xml file.
Here's how I do it:
     <servlet>
          <servlet-name>AcctID</servlet-name>
          <display-name>AcctID</display-name>
          <jsp-file>/AcctID.jsp</jsp-file>
          <load-on-startup>-1</load-on-startup>
     </servlet>Put one of these tags for each JSP you want to pre-compile. The -1 load-on-startup value is important.
CowKing

Similar Messages

  • How to pre-compile jsp and deploy to tomcat

    Hi All,
    I wuld like to know how to pre-compile JSPs and deploy to tomcat. I am using ANT tool to build and deploy the war file.
    Thanks in Advance.
    Regards,
    --Nagesh.                                                                                                                                                                                                                                                                                                                                               

    for Tomcat 5.0 (You'll need to edit to fit your needs)
        <path id="jsp.classpath">       
            <!-- point classpath to directory containing jasper-compiler.jar and
                   jasper-runtime.jar -->
            <fileset dir="C:\tomcat\common\lib">
                <include name="**/*.jar"/>
            </fileset>
            <fileset dir="C:/tomcat/common/endorsed">
                <include name="**/*.jar"/>
            </fileset>       
        </path> 
        <target name="jsp" >
        <!--
             The Ant JSPC task doesn't work with Tomcat 5.0
             so in the meantime we need to define our own task.
          -->
        <taskdef name="jspc50" classname="org.apache.jasper.JspC">
            <classpath>
                    <path refid="jsp.classpath"/>    
            </classpath>
        </taskdef>
        <jspc50 outputDir="${build.classes}"
                package="jsp"
                uriroot="${project.dir}/web/webApp"
                webXmlFragment="c:/web.xml"
                verbose="9"
                validateXml="false">           
        </jspc50>
        <javac srcdir="${build.classes}/jsp"
               destdir="${build.classes}"
               debug="true"
               optimize="false"
               includes="**/*.java"
               source="1.4">
                <classpath>
                    <path refid="classpath"/>
                    <path refid="jsp.classpath"/>
                </classpath>          
        </javac>
    </target>    More information can be found here :
    http://www.onjava.com/pub/a/onjava/excerpt/AntTDG_chap8/index1.html?page=last

  • How to pre-compile JSP?

    Does anyone know how to pre-compile JSP so as to get faster browsing response?

    I know little about JSPs but from what I can remember, JSPs are compiled first time when they are being asked to be executed .Unless changes are made to those programs they would not be compiled, as a result of that, it would run faster. Correct me if I am wrong though

  • How to pre-compile a JSP

    Hi all,
    I struckup with a doubt as fallows
    How to pre-compile a JSP to Servlet(.class file) bfore the first request ,so that the first response takes same time as later responses.

    Thanx Ram for ur response,
    I know Tomcat is assembled with Jasper compiler.My actual doubt is I want to precompile the Jsp bfore the first request. Actually the compilation occurs at the time of first request.U said it is server specific ,can u plz s let me know the pre-compile option for WEBLOGIC Server.

  • How to Use another JSF page that I load by XMLHttpRequest?

    Hi everyone, I'm a newbie of JSF and curisous about how to load page content seperately by AJAX.
    I saw example of Java Blue Print. It's load some data to use in page. What I want is to load another JSF page when click a link or button, (Like include another page). And work with functions privoided by loaded JSF Page.
    My example is, In a main page. I request a JSF page and set it into a div layer.
    var requestURL = "/admin/customer/customer-list-body.faces";
    var content = postDataWithoutContent(requestURL);     divContent.innerHTML = content;     
    All JSF components are required under <f:view>, thus action of form is set as "action='"/admin/customer/customer-list-body.faces'"
    But my page is main.jsp. Each time I click command button in customer-list-body.faces, the url will change to customer-list-body.faces, I want to request and hold in main.jsp.
    What can I do then? Any advices?

    Hi,
    the list doesn't seem to be your problem. You need to track down the illegal argument exception. Once you have that sorted out, expose the method on the AM so it gets shown as a method binding. The return values then could be picked up in a managed bean to create the select Item list
    Frank

  • How to get rendered JSF page (send it as HTML email)

    Hello,
    I would like to send notification email in my application. Could you please help me to find a way how to get HTML result of JSF page as string-file-stream. Simply anything I could handle and use it as email body or attachment.
    My use case: User click to button (raise a action) which change something in DB and confirmation.xhtml(.jsf) is shown to him to confirm that this action was succesful. And I would like to send notification email to all other users with this page (simplified version).
    I need a something like String getJsfPage(String url) but I could not find anything in JSF API.
    Thanks for any clue.

    quote gimbal2: +...now write the code to generate the email body...+
    Thanks for reply...
    Is that mean that I could not use already written code (confirmation.xhtml)? The beuty on JSF is that JSF parser take care about CSS styles, EL, templating (ui: ...), ... When anybody (administrators) wants to change how this email looks - just change this XHTML file.
    How should I write email body? I thought about several way but nothing what looks good:
    - I really dont want to use StringBuilder do build HTML.
    - I dont want to write my own parser of .xhtml template (confirmation.xhtml).
    - Write HTML (xml) template and parse it with XSLT transformation seems to me acceptable but complicated. Needs a special library to perform XSLT, complicated template service (future changes)
    - JSP page, more-or-less the same problems like JSF page
    The sad is that this email (html) body is quite small but highly dynamic (css, language of texts, logos...).

  • How to display a JSF page inside center part of panel of another page?

    How can I display a second JSF page inside my center part of Stretch layout in my First page on click of a commandImageLink of First JSF page? Can anyone help me in this with some example?

    Here is a tutorial that will introduce you to the concepts of taskflows, page fragments and regions - http://www.oracle.com/technology/obe/obe11jdev/ps1/boundedtaskflow/bounded_task_flow.html

  • Need HOW-TO on dynamic JSF pages

    How can we change a page dynamically? For example, I want to create an image tag but I do not know the name of the image until runtime. In fact it is a temporary file name that is geneated by a servlet .
    If this was a standard JSP page I would create a JSP tag with a "name" property . Can JSP tags be used on JSP pages and if so where do they show up in the Creator IDE?

    A technique that I have achieved in my app is to set the image url dynamically through the image url like this...
    THIS ONLY WORKS IF YOU HAVE USERNAME OR SIMILIAR FOR CLIENT SET IN SESSIONBEAN1 (JDBC/LDAP, Login, etc...)
    1. Close Creator locate an example jpeg that you want to bind dynamically.
    2. Open your Projects directory (outside of Creator is how I did) navigate to web/resources make an images directory inside of resources.
    3.Rename your example image something like...
    template1username.jpg
    (Hope I don't have to say that above username will correspond to whatever username you would like to bind the url to so when they are logged into your app they will have dynamic image just for them)
    4. Paste the renamed jpeg into the newly created images directory.
    5. Go back into Creator open your app and drop an image component onto the page.
    6. Make sure it is selected and go to properties pane -- url -- click the ellipses.
    7. NOTE I tried to use property binding and Creator wouldn't retain my url.
    8. Go to Use Value and then navigate to the images directory to the example renamed jpeg and select it so the url displays on top.
    9. Now all you have to do is manually add the binding in the url this way Creator doesn't seem to complain and the JSF Tag remains in the url
    10. To add the binding manually just replace username with the necessary binding expression for me it was...
    /resources/images/template1#{SessionBean1.loginBean.username}.jpg
    now run the project once logged in navigate to page with bound image and voila! It should be there and now all you have to do is add the images properly renamed to the images folder and anybody with a username and corresponding image in the directory gets a personalized image when they are logged in. This is probably not the best way to do this, but for what I was trying to achieve coupled with the fact that I am a NOOB it works pretty darn good.

  • How to create a JSF page on fly?

    I have created a login application. After successful authentication, I want to create a JSF page on fly that contains different menu oprtions based on user's authority. My question here is that is it possible to create a JSF page on fly? If yes, then how?
    My working environment is RAD6.0, Websphere6.0
    Please Advise.

    Ok you have something like this
    <f:view>
    <h:form id="mainForm" />
    <h:form >
    </f:view>
    in your code you have
    UIComponent mainForm=FacesContext.getCurrentInstance().getViewRoot().findComponent("mainForm");
    then you can do
    Application app = FacesContext.getCurrentInstance().getApplication();
    HtmlInputText in = new HtmlInputText() ;
    in.setStyleClass("myClass");
    ValueBinding vb = app.createValueBinding("#{myBean.myProperty}");
    in.setValueBinding("value", vb);
    mainForm.getChildren().add(in);
    the other option instead of doing the mainForm.getChildren().add(in);
    in your jsp page you can have
    <h:inputText bininding = "#{myBean.myInputText}" />
    where myInputText is a HtmlInputText
    that way you can position your componets in your jsp and create them in your backing bean

  • How to run and JSF page from Bea Weblogic 8.1

    Hi, I am new to JSF . Can anybody help me that how can i access a JSF page from Bea Weblogic 8.1. How can deploy. What libraries and files are needed and where to put these required .jar or library files. I just wrote a single page and now i am not able to run it . Any help would be highly appreciated.I am looking forward for your kind replies.Thank you.
    Regards,
    Waqar

    You need to package your application into the standard .war format. Make sure jsf-api.jar and jsf-impl.jar are placed in WEB-INF/lib, your faces-config.xml is in WEB-INF, and your tld files are defined appropriately. Once you have your .war file, deploy it to your servers applications directory or use the console for deployment.
    You should not have any problems if everything is packaged correctly. I am successfully using WebLogic Server 8.1 with my JSF-based web app.

  • How to open a jsf page on a link with a record . Link is in email

    Respected Friends ,
    I am facing a need for sending a email link to users for opening a form for processing a record . I have created a servlet for forwarding the user to the desired page on which we need to render a perticualr record. The servlet forwards the user to the required page but when the page is rendered it gives
    java.lang.NullPointerException     at iffco.wf.view.servlets.UserLinkRedirectServelt.getApplicationModule(UserLinkRedirectServelt.java:143)     at iffco.wf.view.servlets.UserLinkRedirectServelt.doPost(UserLinkRedirectServelt.java:125)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:712)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.1) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    Please help me ,
    I want to know how i can load a page from a link with a perticular record .
    I am using jdeveloper 10.1.3 . Also when i acess the current application module from the servlet it gives me the null pointer exception.
    Thanks in advance

    HI FRANK THANKS FOR THE QUICK REPLY I AM PASTING THE CODE OF MY SERVLET..
    frank can you please provide me how to pass parametres along with jspx link and how to acess them in the managed bean .this will also solve my problem.
    package iffco.wf.view.servlets;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import iffco.wf.view.backing.LoginPageBean;
    import iffco.wf.view.utils.ADFJSFUtils;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import iffco.wf.model.wf_servicesImpl;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import oracle.adf.controller.v2.context.LifecycleContext;
    import oracle.adf.controller.v2.lifecycle.PageController;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCDataControl;
    public class UserLinkRedirectServelt extends HttpServlet {
        private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
        /**Process the HTTP doGet request.
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
                                                               IOException {
            String var0 = "";
            String var1 = "";
            String var2 = "";
            response.setContentType(CONTENT_TYPE);
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head><title>UserLinkRedirectServelt</title></head>");
            out.println("<body>");
            out.println("<p>The servlet has received a GET. This is the reply.</p>");
            out.println("</body></html>");
            out.close();
            System.out.println("Inside doget method of servlet");
            LoginPageBean LoginBeanInstance = new LoginPageBean();
            System.out.println("Login bean initiated--->" + LoginBeanInstance );
            String nextJSP = "/faces/LoginPage.jspx";
            RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
            dispatcher.forward(request,response);
        /**Process the HTTP doPost request.
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException,
                                                                IOException {
            String var0 = "";
            String var1 = "";
            String var2 = "";
            response.setContentType(CONTENT_TYPE);
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head><title>UserLinkRedirectServelt</title></head>");
            out.println("<body>");
            out.println("<p>The servlet has received a POST. This is the reply.</p>");
            out.println("</body></html>");
            out.close();
            System.out.println("Inside post method of servlet");
            LoginPageBean LoginBeanInstance = new LoginPageBean();
            System.out.println("Login bean initiated--->" + LoginBeanInstance );
            String        amDef = "iffco.wf.model.wf_services";
            String        config = "wf_servicesLocal";
            wf_servicesImpl service = (wf_servicesImpl)Configuration.createRootApplicationModule(amDef,config);
            System.out.println("service created --> "+ service);
            ViewObject vo=service.getLoginVO();
            System.out.println(vo);
            vo.setNamedWhereClauseParam("p_personal_no","109128");
            vo.setNamedWhereClauseParam("p_password","abc");
            vo.executeQuery();
            System.out.println("View Object has -->"+vo.getEstimatedRowCount()+" Rows");
            ADFJSFUtils newHelperClass = new ADFJSFUtils();
            System.out.println("New Helper Class Initated -->"+newHelperClass);
            ApplicationModule currentAM = newHelperClass.getDataControlApplicationModule("wf_servicesDataControl");
            System.out.println("Current AM is -->"+currentAM);
            ViewObject vo = currentAM.findViewObject("LoginVO");
            System.out.println(vo);
            vo.setNamedWhereClauseParam("p_personal_No","109128");
            vo.setNamedWhereClauseParam("p_password","abc");
            vo.executeQuery();
            System.out.println("View Object has -->"+vo.getEstimatedRowCount()+" Rows");
            System.out.println("Before method");
            wf_servicesImpl wfser=getApplicationModule();
            System.out.println("after method value got-->"+wfser);
            String nextJSP = "/faces/LoginPage.jspx";
            RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
            dispatcher.forward(request,response);
        public wf_servicesImpl getApplicationModule() { 
                 FacesContext context = FacesContext.getCurrentInstance(); 
                 System.out.println("context --"+context);
                 ValueBinding vb = context.getApplication().createValueBinding("#{data}"); 
                 BindingContext bc = (BindingContext) vb.getValue(context); 
                 DCDataControl dc  = bc.findDataControl("wf_servicesDataControl"); 
                 return (wf_servicesImpl) dc.getDataProvider(); 
        private void redirect(
            ResponsePage aDestinationPage, HttpServletResponse aResponse
          ) throws IOException {
            String urlWithSessionID = aResponse.encodeRedirectURL(aDestinationPage.toString());
            aResponse.sendRedirect( urlWithSessionID );
          private void forward(
            ResponsePage aResponsePage, HttpServletRequest aRequest, HttpServletResponse aResponse
          ) throws ServletException, IOException {
            RequestDispatcher dispatcher = aRequest.getRequestDispatcher(aResponsePage.toString());
            dispatcher.forward(aRequest, aResponse);
    }

  • How To Reload The JSF page

    Hi all,
    I am working on an application in which I have three inter-related tables ( Master-Detail-Detail ). I created two forms and one table from the datasources of these Master-Detail-Detail table. I added corresponding createInsert
    and commit operations for each of my form and table on the JSF page. The tables have 3 colums one of which is generated by a sequence in the database. I am displaying that as an output text in my page. When I am creating the new row in that table it is not getting displayed till I reload the page by hitting the url. based on that value I should create the rows in the other tables.
    The application should work in the below fashion
    1. I should able to create a row in the first table using CreateInsert operation. ---> I am able to create and could see the row in the db
    2. I should able to create a row in the second table which is child of first table. Dynamically it should take the value of one of the tables attribute for foreign key. ---> This is happening only if I reload the page manually by hitting
    the url....but not happening if I dont reload it. I guess the Iterator is not getting refreshsed.
    I need to reload the page either programmatically or using ADF Configuration. Please help me in doing that.
    Thanks in Advance

    Did you set up a composite relationship between the master and detail?
    This should take care of automatically bringing in the right master id into new records you are creating in the detail part.
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcentities.htm#sm0150
    Also instead of doing a full page reload, it would probably be better to do a partial page refresh for the section you need to refresh.

  • How to deploy portalized JSF page to WLS_portlet managed server

    Hi,
    I'm a newbie in webcenter development and I'd like to ask what are the proper steps in deploying a portalized JSF page. Here are the steps I did
    1. Create a WebCenter application using WebCenter template
    2. Create JSF page
    3. Create Web Service Data Control (the page should invoke a webservice or BPEL process)
    4. Drag and Drop the data control onto the page as an ADF Parameter form
    5. Create Portlet Entry. Save All. Run the page in JDeveloper -> it's working fine. the service/process is being called successfully
    6. I created the necessary JAR,WAR and EAR files.
    7. Started WLS and Managed Servers (WLS_Portlet and WLS_Spaces)
    8. Deploy the custom application using Fusion Middleware Control to WLS_Portlet
    9. Bounce POrtlet managed server
    10. Register the portlet producer using Fusion Middleware Control
    11. Login to WebCenter Spaces
    12. Create New page and add Component - my new portlet
    Now, the page loads my portlet, but when I click the button that will supposedly call the service, I either receive SOAP version mismatch error (for the webservice connection) or nothing happens/no response (for the BPEL process).
    Did I miss anything? Do have to configure other things in order to make it work?
    Please advise.
    Thanks!
    Rian

    Sorry, this seems to be working now. I just have to close all applications in order for the memory to call the actual BPEL process

  • How to create a JSF page wich filter a Table, similar to an ORACLE ADF LOV?

    I want to create a JSF Page with a table and filtering capabilities similar to ORACLE ADF LOV(List Of Values) (or similat to ORACLE Forms LOV)
    So, we have a page wich contain a Table and a text field and search button.
    The field will contain the search criteria and the button will submitt the search.
    The search criteria shoult be applied on a table column and the result be rendered.
    An example can be : http://technology.amis.nl/blog/?p=1933 realized in Oracle ADF technology.
    Can anyone find a similar example in JSF/Netbeans ?
    Thanks!

    To realize a LOV may be usefull a filter on the table:
    http://webdev2.sun.com/woodstock-tlddocs/webuijsf/table.html#TableFilter

  • Unable to compile JSF page

    Hi All,
    I am new to Jdeveloper . I am creating a JSF application in jdeveloper10.1.3.when i place a <F:loadBundle > tag and other components in jspx. i am getting the following compile time error.
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "basename" of tag "loadBundle".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "basename" of tag "loadBundle".
    Error: Attribute: showPopupOnDisconnect is not a valid attribute name
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "selectItems".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Please any one help me to solve these issue.
    Thanks in advance,
    Vijay
    Edited by: user10619370 on Jul 29, 2009 7:52 AM

    Can you post the code of your page, this is an standard JSF tag and you should not have problems on using it
    I found this guide on how to use it on standar jsf applications
    http://www.laliluna.de/javaserver-faces-message-resource-bundle-tutorial.html
    -Juan Camilo

Maybe you are looking for

  • MR8M post a different GL account versus MIRO

    Hi Gurus, Any idea why MR8M posted a different GL account from the original entry? here are the entries: MIRO Debit- GR/IR clearing      100 Debit- Expense(manual)    20 Credit- AP vendor                120 MR8M   Debit- AP vendor          120 Credit

  • Won't start and stuck at "Loading ExporterQuick TimeHost.pm"

    Hi, I just upgraded from CS4 to CS5.5. Been using Premiere for ages, but when I was editing just now it crashed and when I tried to start it up again it loads at stops at "Loading ExporterQuick TimeHost.pm" I was editing a 720 HD project with 1080 HD

  • How to display a default value in BI Publisher

    Hello friends, I need to display a report based on supplier wise or dept wise stock.i've taken parameter type as menu and selecting the values from the drop down list for ex(1,2,3...)... what i want is I should display a default value like select ite

  • Adding soap header in java

    Can anyone please tell me how to add following security header in Webservices (WS 1.0 ) client using java code? (I m using axis 1.4) <soap:Header> <wsse:Security soap:mustUnderstand="1"> <wsse:UsernameToken> <wsse:Username>[email protected]</wsse:Use

  • Passing url variable - what am I doing wrong?

    I've made a form and am attaching the code. Basically I am trying to get a list of offices and select one (which I am able to do when I publish and run the webpage/form). However, it always passes the value of "1" (the first record) to the next page