JSF 1.2 web.xml configuration parameters

Actually, I know these JSF 1.2 web.xml configuration parameters:
javax.faces.CONFIG_FILES
javax.faces.DEFAULT_SUFFIX
javax.faces.LIFECYCLE_ID
javax.faces.STATE_SAVING_METHOD
Are there any more available?
(I have to study its performance implications in conjunction with RichFaces ones).

The JSF 1.2 specification document would contain the information you're looking for.

Similar Messages

  • JSP include through a web.xml configuration

    I have a website that has many JSP pages and I would like to add some logging lines to each jsp file. I would prefer not to have to edit each jsp file though (it would be time consuming). Is there a way through a configuration change in the webapp web.xml file to make each jsp page first "go through" a servlet (to perform some logic) and then have the servlet pass the request and response on to the jsp file. If so, I could add the logging logic to the servlet and effectively have the logic added to each jsp file.
    If anyone has done something like this, please give me some pointers on how to configure it.
    Thanks,

    It sounds like a servlet filter is what you are after.
    http://java.sun.com/products/servlet/Filters.html
    Its pretty much exactly what you had, just using a Filter interface instead of a servlet.
    Should be something along the lines of this (untested)
    In web.xml:
    <filter>
    <filter-name>jsplogger</servlet-name>
    <filter-class>dagger.servlet.JSPLoggerFilter</servlet-class>
    </filter>
    <filter-mapping>
    <filter-name>jsplogger</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>Filter class:
    public class JSPLoggerFilter implements Filter{
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
      String s=request.getRequestURI();
      System.out.println(s+" "+request.getSession().getId());
      // pass it on down the chain
      chain.doFilter(request, response);
    }Cheers,
    evnafets

  • Web.xml configuration

    Hi,
    I want to configure web.xml in such a way that all requests will be handled by a single servlet. I don't have anything common for all requests in the url pattern.
    <servlet>
         <servlet-name>myServlet</servlet-name>
         <servlet-class>com.app.test.MyServlet</servlet-class>
         <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
         <servlet-name>myServlet</servlet-name>
         <url-pattern>/*</url-pattern>
    </servlet-mapping>
    I tried to configure this way, by making url-pattern as /*. But its running into an infinite loop.
    I also tried giving the context name in the url-pattern, <url-pattern>/mycontext/*</url-pattern>. Unfortunately this also doesn't work for me.
    Solutions/suggestions are welcome. Thank you.
    -Prasanna

    Using "/" or "/*" will make one servlet as the default, so you're on the right track there. However, keep in mind that a more exact match or a longer match will win in case of conflict.
    The infinite loop you talk about is probably because you try to redirect from within your handler servlet and that new request obviously gets intercepted again.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • Web-inf\web.xml init parameters

    Hi,
    I use several servlets/JSPs which are using common init parameter, is there a way to specify that some init parameters are common or must I write all the parameters for all of my servlets/JPSs ?
    Thanks

    yah that's what I mean, have your parameters in your web.xml file and have a Servlet read them when the application starts up (using ServletConfig). Then you put the values into the application scope where all the JSPs and Servlets can read them. So lets say you specify a parameter called "html-path" with a value of "/www/html/" you could read this in your JSPs like this:
    String htmlPath = application.getAttribute("html-path");I can't remember how to do his off-hand but I know it works.

  • Web.xml  configured correctly(I think),  but still getting '404...resource

    not found error' from tomcat. Here is my web.xml:
    <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>HelloServlet2</servlet-name>
    <servlet-class>coreservlets.HelloServlet2</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/classes/HelloServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloServlet2</servlet-name>
    <url-pattern>/classes/coreservlets.HelloServlet2</url-pattern>
    </servlet-mapping>
    </web-app>
    when I went to the following urls after I had edited web.xml to the above,
    http://localhost:8080/cucoweb/classes/coreservlets.HelloServlet2
    http://localhost:8080/cucoweb/classes/HelloServlet
    I go the expected results, ie, 'Hello(2)' and 'Hello'. Then I shutdown tomcat and restarted it.
    And when i tried to access those 2 urls again, I got the above error.
    (Actually I had the same web.xml before except that it didnt have the /classes in front in the
    url-pattern. I was able to access it by the same url - without the /classes - and then the next day
    when started tomcat and tried to access it, it didnt work, same error.)
    In this example, cucoweb is the context root, correct ? Shouldn't the url-pattern be relative to the
    context root ? Thats how I have it now, I think.
    Would adding my webapp directory, ie cucoweb/classes, to my CLASSPATH help ?
    I'm in ubuntu, when I do echo $CLASSPATH, I get :
    .:/usr/lib/jvm/java-6-sun-1.6.0.00/lib:/usr/lib/jvm/java-6-sun-1.6.0.00/imq/lib/:/usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib
    I havent tried this yet because doing this is kind of tricky in ubuntu. (You have etc/environment and
    bash.bashrc, for ex.) But if I try that and it works I will post about it. I suspect its something else,
    though, because it worked once, before restarting tomcat, thats why I'm posting here first.
    Any info, even educated guesses, would be greatly appreciated. Thanks in advance.

    Thanks for the reply. Here is my web structure :
    /usr/local/tomcat/apache-tomcat-6.0.14/webapps/cucoweb/WEB-INF/classes
    From my understanding you are supposed to have your own webapp deployment directory
    under webapps, ie, cucoweb, and not use webapps/ROOT. (I'm not sure what /ROOT is even for)
    My web.xml is in WEB-INF. My /classes directory contains HelloServlet.class and a directory
    called coreservlets which contains HelloServlet2.class.
    I'm not sure what you mean by 'better you to delete under tomcat/work/catalina/localhost folder'.
    Can you please clarify ?
    FYI, my work/catalina/localhost contains the following :
    cucoweb docs examples host-manager manager
    Here cucoweb just contains a SESSIONS.ser file. Are you saying i should delete that ?

  • Web.xml configuration for initial servlet load

    Hi all,
    I have heard of entering some tag into web.xml file (deployement descriptor) if we need some servlets to be loaded wheneve the app server starts or restarts. can some body help me regarding what to write in web.xml.
    thanks in advance

    I am having some problems with the same issue although specifying the load-on-startup param is not working for.
    Here is snipet of the web.xml:
    <servlet id="Servlet_1206024889339">
    <servlet-name>ContentServer</servlet-name>
    <servlet-class>COM.FutureTense.Servlet.SContentServer</servlet-class>
    <init-param id="InitParam_1206024988781">
    <param-name>inipath</param-name>
    <param-value>/data/WebSphere/ContentServer</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    This however doesn't init the contentServer servlet. Is there anythign else i need to check? I am using websphere5-1.
    I saw somewhere you might have to specify a loadonstartup=true? Where is this set?
    I know the app is reading the right web.xml because i put in a bad value and saw the error being outputted in the startup log.
    There are some servlets being initialised on startup but not the ones I want. These servlets don't seem to be in the web.xml.
    [10/10/08 11:53:30:265 IST] 1e06de8 WebContainer A SRVE0169I: Loading Web Module: cs.war.
    [10/10/08 11:53:33:330 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: JSP 1.2 Processor: init
    [10/10/08 11:53:34:098 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: SimpleFileServlet: init
    [10/10/08 11:53:34:117 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: DirectoryBrowsingServlet: init

  • How to modify web.xml init parameters?

    Hi all!
    I need to modify my application's init parameters on the fly.
    I think that if i can get those parameter through FacesContext, then i should can set them too.
    Anybody knows if it is possible ou how to do it?
    Thanks,
    Cezar

    Hi all!
    I need to modify my application's init parameters on the fly.
    I think that if i can get those parameter through FacesContext, then i should can set them too.
    Anybody knows if it is possible ou how to do it?
    Thanks,
    Cezar

  • Catch the exception thrown when database is not available in web.xml

    Hi,
    I have an app that uses a mysql database configured in the web.xml configuration file - a javax.servlet.jsp.jstl.sql.dataSource param
    There have been occasions where that server has been down, and this causes the expected error stack trace to be dumped to the jsp page
    Is there anywhere I can catch that exception in the jsp page, so the end user does not see that nasty error?
    Thanks,
    Tom

    You have answered your own question, catch the exception with a try catch block !!
    try
    // doing something stupid
    catch (Exception exception)
    out.println("sorry user, you did something really stupid");
    // it is acceptable to do nothing here if you dont want to handle the
    // error or output a message
    }

  • Is there a web.xml equivalent???

    does the Apache web server included with Oracle 9ias have an equivalent to the web.xml configuration common with applications deployed on Tomcat?
    I am attempting to port a Tomcat application to 9ias but I have been unsuccessful because I am having problems with jars not being found. I checked the demos that come with 9ias and noticed that they don't have a web.xml file. I am thinking this may be one of my problems.
    any insight or pointers to documentation about this would be greatly appreciated.
    I've read a lot of documentation and new group posts but have been unable to find a solution to my problem.
    thank you

    Is this one of the cases that were inscribed on the inside by Jobs, Wozniak, and the rest of the design team?  I could take it apart, but I really don't want to as the computer still works perfectly.  The reason I am asking, is that when I had it repaired many years ago, the tech guy said he would like to buy it.  I asked him why, since it has only 512k of memory, and he said he would like to have it as it is, indeed, inscribed.  He did not take a photo @ the time, so I am asking if there is a record of how many cases were inscribed?
    We bought the computer from my sister-in-law who was in computer science engineering @ the University of Illinois and bought it thru the university.
    Thank You again!
    Mark

  • Problem displaying error page of web.xml when using JSF, Ajax4jsf

    Hi,
    My application is using MyFaces, RichFaces and Ajax4jsf. When i try to display error page configured in web.xml, i am getting exception "Error while processing error page".
    my web.xml contents are as follows:
    <?xml version="1.0"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <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-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>
    org.apache.myfaces.webapp.filter.ExtensionsFilter
    </filter-class>
    <init-param>
    <description>
    set the size limit for uploaded files. Format: 10 - 10 bytes 10k
    - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>100m</param-value>
    </init-param>
    <init-param>
    <description>
    Set the threshold size - files below this limit are stored in
    memory, files above this limit are stored on disk.
    Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>Seam Redirect Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
    </filter>
    <filter>
    <filter-name>KTServletFilter</filter-name>
    <filter-class>com.kenexa.core.system.KTServletFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Seam Redirect Filter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>KTServletFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- seam Listeners -->
    <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.kenexa.kr.web.KRServletListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>faces</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsf</location>
    </error-page>
    </web-app>
    As per the configuration, when exception is thrown out of the application, container tries to display systemError.jsp page. If we want to include the JSF tags in systemError.jsp page, the request should pass through FacesServlet, so in the <error-page> <location> tag systemError page is specified with the extention systemError.jsf though it's actual extention is .jsp
    When exception is thrown from the application container invoke the error page but, while rendering systemError.jsf page exception is thrown saying "Exception processing error page "systemError.jsp" "
    To solve this problem i've gone through several forums, materials.
    In one forum a guy said, JSF1.1 spec has some problem in displaying error pages. To solve this don't write <f:view> tags in the error page, use <f:subview> intstead. By reading this, i again changed the contents of systemError.jsp page replacing <f:view> by <f:subview>. But the error is still repeating.
    Finally what i found is, when we use Ajax4jsf in the application, its AjaxViewRender class is throwing exception while rendering error pages configured through web.xml.
    So what i did is i changed error page extention from .jsf to .jsp in the <location> tag. Now jsf won't come in the picture and remove JSF related tags from the systemError.jsp page.
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsp</location>
    </error-page>
    Any comments are welcome----------------------------------------------------------------

    I too iam facing the same problem could you advise if you have found any solutions
              -Ram

  • How to configure a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I wrestled with this for a long time. I may have done something wrong, but to get my mySQL JDNI reference to work, I had to add it to the server.xml file. You can try with web.xml, but I eventually just got frustrated and put it in server.xml.
    The following is between two <context> tags:
    <Resource name="jdbc/instance_name_goes_here"
                   auth="Container"
                   type="javax.sql.DataSource"/>
              <ResourceParams name="jdbc/same_instance_name_here">
                   <parameter>
                        <name>username</name>
                        <value>user_name_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>password</name>
                        <value>password_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>driverClassName</name>
                        <value>jdbc_fully_qualified_class_name</value>
                   </parameter>
                   <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
                   <parameter>
                        <name>url</name>
                        <value>jdbc_connect_url_database_vendor_specific</value>
                   </parameter>
                   <parameter>
                        <name>maxActive</name>
                        <value>8</value>
                   </parameter>
                   <parameter>
                        <name>maxIdle</name>
                        <value>8</value>
                   </parameter>
              </ResourceParams>
    - Saish
    "My karma ran over your dogma." - Anon

  • Configuring a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I'm pretty sure you can't do it that way round. The logic of the thing is that database access URLs etc. tend to depend on the where the server is. The whole idea of these resources is to put the stuff that's specific to the server in server.xml and refer to it using names that should remain the same if you deploy your webapp on another server. Of, for example, you have test, stage and production servers running the same webapps but connecting to different databases.

  • How to read configuration data from an xml file (not web.xml)?

    Hi,
    I want to separate the application specific configuration parameters in a separate xml file and read them as and when they are needed? I know that I can use the wb.xml but I want to separate them in a different xml file because I don't want the web.xml file to be played around later after deployment. If any change is needed then it should be done in the application-config.xml.
    How can I read the parameters from this xml file in my jsp code and also what should be the location of this file if I have
    ../webapps/Root/application
    directoty structure ?
    Any help is greatly appreciated.

    can you give an example of a property file and also
    it is loaded in the jsp ?Hmm... loading properties in a JSP is not a very good idea. You should do it in a separate class, rather than mixing the logic with the display logic.
    Properties properties = new Properties();
    properties.load(UtilClass.class.getResourceAsStream("config.properties"));
    // Add a try - catch block around the load
    // for IOException...

  • JSF - How to set up tag libs in web.xml file?

    Hello all,
    I have a doubt... that in an JSF application we are using two tag libraries, one for the core and other for html components. Both these *.tld files are jared inside "jsf-impl.jar" file.
    The problem is that when i start the web server (Tomcat4.0.6) the console shows that taglib tag must be configured... this means that we have to specify the "<taglib></taglib>" elements in the web.xml file of the jsf application... but how do configure the jar file...
    please guide...

    Putting the JAR files in WEB-INF/lib and using the standard URIs in the taglib directives are all that's needed; the container locates the TLDs in the JAR files at startup.
    If this doesn't work, it's a bug in the container. You may want to upgrade to a later version of Tomcat; 4.0.6 is ancient, and may very well be buggy in this area.

  • Jsp configuration load on start up in web.xml

    Is my configuration for jsp correct.i want my JSP to be loaded after servlet initialised.What changes i need to do to make it work on any server..like tomcat or websphere
    <!-- JSP CONFIGURATION -->
    <jsp-file>/hello.jsp</jsp-file>
    <load-on-startup>2</load-on-startup>
    <!-- SERVLET CONFIGURATION -->
    <servlet>
    <servlet-name>MyServlet</servlet-name>
    <servlet-class>com.example.HelloServlet</servlet-class>
    <!-- or -->
    <jsp-file>/hello.jsp</jsp-file>
    <!-- optional and one only, greater value than 0 means don't wait for the first request load it beforehand -->
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>MyServlet</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    Message was edited by:
    raghuveer_vellanki

    when you give a load on startup value as 1 for a servlet declaration in the web.xml the Server calls your servlet when u start it, and calls means the server loads your servlet anc calls the init method. so u may do whatever you like in init method like starting some other application, setting some parameters , etc

Maybe you are looking for

  • Help needed in search help exit

    Hi Experts,    I have used a search help exit in IL03 transaction to include a field in a particular search tab. I have written the code in timepoint PRESEL1 and it is showing the search field in that search tab when I directly enter into that tab. B

  • You Tube Help Video's

    I'd like to suggest (again, yawn ) that the You Tube help video's be subtitled for the profoundly deaf/hard of hearing users who are BT customers. If sub-titles are technically not possible, how about making the script of the video available to be re

  • Will there be a CLEAR bumper available for the iPhone 4?

    Anyone know about a clear iPhone 4 bumper available in the US? I saw one online from a tech site in Europe, but they only ship to Europe and Asia... I figured if there was a clear bumper, we could still enjoy the look of the steel portions of the iPh

  • Freehand doesn't work anymore

    Can anyone help me... I've tried looking everywhere to find help...? Since I've upgrade to Tiger 10.4.6 on my desktop, Freehand will not open... I've tried all the usual stuff. i've even re-installed FH and it still will not start. I get the bouncing

  • "No Service" signal strength related

    So I got my iPhone and went through the set up on iTunes. I am porting from Verizon so it told me that they are working on my activation. Anyway, My phone says "No Service" up in the signal strength area. I walked around my house and it did not chang