Netbeans 6.1 + Facelets + Tomcat6

Hi,
I have set up my development environment. I have installed the facelets plugin on netbeans 6.1 and also icefaces plugin(to take advantage of code auto completion) with no problems. When I create any project with only facelets support and deploy it in glassfish it works fine. However when I create any project and select tomcat6 as the server I always have a problem like:
HTTP Status 404
description The requested resource (/MyWebApp/welcomeJSF.xhtml) is not available.
This also happens when I create any project with both facelets and icefaces support and deploy on glassfish or tomcat.
I will appreciate any help or pointers.
alex

The CrudFX code uses the old syntax.
The JavaFX Script Preview version uses new one: [http://java.sun.com/javafx/reference|http://java.sun.com/javafx/reference]
The exception means that a project contains empty file:
=========================================================================
Error in syntactic analysis in DataGrid.fx:
java.lang.NullPointerException
at com.sun.tools.javafx.antlr.v3Walker.module(v3Walker.java:294)
=========================================================================

Similar Messages

  • How to set line break points in JSF Facelets files on NetBeans?

    I am running debugger on NetBeans. I can set line break points for jsp files but cannot for Facelets files with extension 'xhtml'. Dose anybody know how to set break points for Facelets xhtml files? Or is it possible to set break points for xhtml filles?
    Thank you very much.

    You can't. They aren't executable code, they are templates. The only executable code is the part inside #{}.

  • Netbeans 6.0 Visual Web Pack and facelets

    Is it current possible to use Netbeans 6.0 Visual Web Pack and facelets and/or Seams?
    If so please point me to some useful resource.

    >
    ...Below is from the Launch tab:>What exactly is a 'launch tab'? Are you talking about some NetBeans window?
    The reason I ask is that the 'JNLP file' shown, is complete rubbish. It is a bunch of symbols pretending to be a JNLP file. The fundamental problem is that it is invalid (and hence it is not the 'JNLP format' it claims to be).
    How any particular Java implementation deals with an invalid JNLP file is quite unpredicatable.*
    Please people, do not just 'presume' that you (or your IDE) can write a valid JNLP file. Instead - validate it against a DTD or XSD.
    After all.. Garbage in, Garbage out!
    * And to the poster who mentioned that adding the first Jar line twice solved the problem. That is a dangerous and fragile kludge. If it works in some specific microversion of Java, it might (probably will) break in the next.
    Edit 1 - Highlit the most major error in that file using 'code' tags. Hopefully that will make the basic problem more obvious..
    <j2se version="1.5+" java-vm-args="-Djava.endorsed.dirs="C:\Program Files (x86)\NetBeans 6.0.1\java1\modules\ext\jaxws21\api" "/>Edited by: AndrewThompson64 on May 21, 2008 9:20 AM
    Edit 2 - Added possible alternatives..
    <j2se version="1.5+" java-vm-args="-Djava.endorsed.dirs='C:\Program Files (x86)\NetBeans 6.0.1\java1\modules\ext\jaxws21\api' "/>
    <j2se version="1.5+" java-vm-args='-Djava.endorsed.dirs="C:\Program Files (x86)\NetBeans 6.0.1\java1\modules\ext\jaxws21\api" '/>The hard coded path, as well as the use of unescaped backslashes (e.g. '\' as opposed to '\\') also looks suspiciously wrong, but since I only deploy off the internet, I am not entirely sure.
    Edited by: AndrewThompson64 on May 21, 2008 9:26 AM

  • Facelets template (J2EE6 Netbeans 6.8 glassfish v3) ui:composition issue

    Hello every body,
    First please excuse my bad english maybe...
    I'm ready to start a new project with Java EE 6 using netbeans 6.8 and glassfish v3.
    For the Web Tiers, I want to use facelets and JSf 2, but I encounter an issue when I want to create and use a facelets template
    Here are the steps to reproduce my problem (very simple..). Theses steps must be reproduced using Netbeans 6.8 :
    A. Project creation
    1. File > New Project > Java EE > Enterprise Application
    2. Project Name : (no matter) : SampleEE (do not check Use dedicated folder....)
    3. Server : Glassfish v3 Domain (provided with netbeans) / JavaEE Version : java EE 6.
    4. Check Create EJB Module and Create Web Application Module (and do not change default names)
    5. Do not check Create Application Client Module. Then Click Finish.
    B. Add JSF 2 Framework to the Web project
    1. In the project tab, right-clic the web project and clic Properties
    2. Select Frameworks and clic the "add" button and Add Java Server Faces (do not change the default configuration. Make sure to use Facelets (not jsp) as prefered page language in the configuration tab)
    3. Clic OK to confirm and close the window
    C. Create a facelet template
    1. In the web project node, right clic and select New > Other > JavaServer Faces > Facelets Template
    2. File Name : template (and do not change anything else : use CSS and use the first and easiest template. Do Not specify folder). Click Finish
    We get this template at the root of "Web Pages" (css is automatically generated in "resources/css"
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html">
        <h:head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
            <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
            <title>Facelets Template</title>
        </h:head>
        <h:body>
            <div id="top" class="top">
                <ui:insert name="top">Top</ui:insert>
            </div>
            <div id="content" class="center_content">
                <ui:insert name="content">Content</ui:insert>
            </div>
        </h:body>
    </html>D. Create a template client
    1. On the project node, right-clic and select New > Other > JavaServer Faces > Facelets Template Client
    2. File Name : client (do not specify any folder)
    3. Clic "browse" button to select a template, and select the template nammed "template"
    4. Check <ui:composition>" for "generated root tag" value (note the problem occurs even if we check "html")
    We get this file :
    {code}<?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
    template="./template.xhtml">
    <ui:define name="top">
    top
    </ui:define>
    <ui:define name="content">
    content
    </ui:define>
    </ui:composition>
    {code}
    E. Execute
    Now just clean and build and Run the project.
    1. Right Clic the project node and select Clean And Build
    2. Right clic the project node and select Run
    3. Wait for the web browser to open and go to the template url : http://localhost:8080/SampleEE-war/template.xhtml (we can see the template displays correctly, with the good CSS style automatically generated)
    4. Now go to the client URL (http://localhost:8080/SampleEE-war/client.xhtml
    There is a problem : tags are not interpreted and client.xhtml just returns a standard xml and no page is displayed. (if you check 'html' instead of <ui:composition> in the steps before, you can see the page, but it's not the correct page, display the page source and you will see all the facelets tags "<ui:composition..."> <ui:define> and so on...
    I don't know what to do to solve this.
    Please help me, i've been searching for so long hours now...
    Note that the project as no faces-config.xml, since it's now optional... I would prefer not to use it.
    Thank you in advance for your help.
    Edited by: Hitsugaya-kun on Jan 16, 2010 5:14 AM

    Kyuubi,
    Thanks for posting anyway. I too was overlooking /faces/* Servlet mapping in web.xml that NetBeans creates.
    Maybe this belongs in an separate thread, but when is <html> a good option to select (versus <ui:composition>) for the Generated Root Tag?
    Roberto
    Edited by: onebeartoe on Aug 11, 2010 6:54 AM

  • Display images in rows & columns using dataTable in JSF 2.0, netbeans 6.9.1

    Hi,
    I have to display only images on a web page in JSF2.0 in Netbeans. I am using datatable and column to do so. But there is one problem.
    All images are display only in single column(i.e. vertically). I want to display in rows and columns not only column.
    e.g. One row will have atleast 3 images and more rows like this.
    Which attribute should i use of datatable? or should i use some other tag?
    My code is:
    <h:dataTable var="images"
    value="#{jsfMBean.allImages}"
    rules="none"
    cellpadding="20"
    border="0" >
    <h:column>
    <h:graphicImage value="faces/WEB-INF/upload/#{images.picid}" width="300px" height="100px" />
    </h:column>
    </h:dataTable>
    Thanks.
    NetBeans 6.9.1
    JSF 2.0 with facelets
    glassfish 3.0
    Enterprise java beans
    PrimeFaces 3.0

    I believe you are looking for the panelgrid, not the datatable.
    Note that there are a few useful websites online that list the available JSF tags plus their properties, such as these:
    http://www.horstmann.com/corejsf/jsf-tags.html
    http://www.exadel.com/web/portal/jsftags-guide

  • About Netbeans 6.5 and Java EE 5 SDK

    Hi, I have already installed JDK 6u11 (with JRE) and Netbeans 6.5, do I still need to install J2EE SDK if I want to develop J2EE programs?
    Thanks!

    That message is true if you did not install the bundled tomcat server that comes included with NB6. Otherwise you will have to start tomat up separately with the tomcat6.exe and add a NEW tomcat server to NB.

  • JSF - Why getting wrong path Handling URLs in Facelets Templates

    Hi, I am trying to do a web application using JSF, Facelets in Netbeans 6.7. but I am having a problem:
    Why I am getting wrong path ?
    It is very simple, straight forward web application.
    When run, it shows the template-client.xhtml perfectly . The navigation menu is shows ok, but they don't work. However, if I enter in the browser address http://localhost:8080/test3/portal/products.jsf it goes perfect to the right page and the navigation between About, Products and Home works perfect. But once I click on Home, the menu start to give me errors. Looks like the path is wrong again.
    folders structure:
    test3My code:
    faces-config.xml:
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <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">
        <application>
            <view-handler>
                com.sun.facelets.FaceletViewHandler
            </view-handler>   
        </application>
    </faces-config>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">
        <context-param>
            <param-name>com.sun.faces.verifyObjects</param-name>
            <param-value>true</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.DEFAULT_SUFFIX</param-name>
            <param-value>.xhtml</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>false</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.SKIP_COMMENTS</param-name>
            <param-value>true</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>*.jsf</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>forward.jsp</welcome-file>
            </welcome-file-list>
        </web-app>forward.jsp:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <jsp:forward page="template-client.jsf"/>template-client.xhtml:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html">
        <body>
            This text above will not be displayed.
            <ui:composition template="/template.xhtml">
                This text will not be displayed.
                <ui:define name="title">
                    Facelets
                </ui:define>
                This text will also not be displayed.
                <ui:define name="body">
                    Hello from the Facelets client template!
                </ui:define>
                This text will not be displayed.
            </ui:composition>
            This text below will also not be displayed.
        </body>
    </html>template.xhtml:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:ice="http://www.icesoft.com/icefaces/component">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <title>Facelets - Template Example</title>
            <link href="#{facesContext.externalContext.requestContextPath}/css/default.css" rel="stylesheet" type="text/css" />
        </head>
        <body>
            <div id="menu">
                <ui:insert name="linemenu">
                    <ul>
                        <li><a href="../forward.jsp">Home</a></li>
                        <li><a href="about.jsf">About Us</a></li>
                        <li><a href="products.jsf">Products</a></li>
                    </ul>
                </ui:insert>
            </div>
            <div>
            <h1>
                <ui:insert name="title">Default Title</ui:insert>
            </h1>
            <p>
                <ui:insert name="body">Default Body</ui:insert>
            </p>
            </div>
        </body>
    </html>about.xhtml:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets">
        <body>
            <ui:composition template="./../template.xhtml">
                <ui:define name="title">
                    title ABOUT
                </ui:define>
                <ui:define name="body">
                    body ABOUT
                </ui:define>
            </ui:composition>
        </body>
    </html>products.xhtml:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets">
        <body>
            <ui:composition template="./../template.xhtml">
                <ui:define name="title">
                    title PRODUCTS
                </ui:define>
                <ui:define name="body">
                    body PRODUCTS
                </ui:define>
            </ui:composition>
        </body>
    </html>

    My folders:
    Test3
         Web Pages
              /WEB-INF
              /css
                  -default.css
              /layouts
              /portal
                  -about.xhtml
                  -products.xhtml
              -forward.jsp
              -template.xhtml
              -template-client.xhtmlPlease, I need help with this. It may is very easy to find out, I maybe skiping something
    Thank for your help anyone!!!

  • Using facelets and Visual web jsf frameworks together

    I am developing a new jsf application and I wanted to make the page navigation simpler like making the content pages independently using woodstock components and including them in the main template page.
    I have downloaded Facelets support plugin for netbeans and installed it. I have created a new project using the wizard and i specified the two (facelets and visual web jsf) as frameworks for use. But I failed to leverage my application with facelets because I don't know how to use woodstock components with facelets.
    I am new to jsf and i want the woodstock visual components. Can't I use facelets then?
    Plz help.

    I managed to find a workaround. Thought i should share it with those who are faced with a similar issue.
    I found that a bug report had been placed in the past with Apache Dev. However, they had said that they would not modify their logic because the servlet container spec requires it (even though isapi_redirector is only a connector and not a container). They said that there is no way for the isapi_redirector to differentiate between /foo/WEB-INF when foo is a context and when foo is just a sub-directory of the ROOT web application. So, the general consensus was to err on the side of safety and risk blocking a few requests that are valid.
    However, this causes a serious issue for those using NetBeans JSF Visual Web Projects. Hence, I created my own flavour of isapi_redirector by modifying the code such that this check is not performed and leaving the onus of checking on Tomcat.
    For those who are interested, the simplest way to go about this would be to force the function uri_is_web_inf (in jk_isapi_plugin.c ) to always return FALSE.

  • Netbeans 6.5 And tomcat

    how can i correctly configure tomcat with netbeans 6.5.. i installed tomcat separately with netbeans.. when i deploy an application. it says "Starting of Tomcat failed, the C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\catalina.bat startup script is missing.
    See the server log for details.
    BUILD FAILED (total time: 2 seconds)"
    Can you please help me with these

    That message is true if you did not install the bundled tomcat server that comes included with NB6. Otherwise you will have to start tomat up separately with the tomcat6.exe and add a NEW tomcat server to NB.

  • Instalar TomCat6 en MAC OS X 10.7.5 ?

    Buenas tardes a toda la comunidad:
    Ser'ian tan amables en informarme o especificarme los detalles siguientes:
    Quiero Instalar TomCat6 en una MacBook Negra, con Sistema operativo OS X version 10.7.5
    1. Que version  de tomcat6 descargo?
    2. Como instalo dicha version?
    3. Que requiero mas, si ya tengo java y netbeans 7.2.1
    Por su fina atencion, mil gracias.

    Necesita actualizar Safari.
    Abrir sysem Preferencias> Actualización de Software y luego haga clic en Comprobar ahora.
    O, haga clic en Actualización de Software en el menú Apple.
    Reinicie el Mac después de que todas las actualizaciones se instalan a continuación, intente Safari.

  • Facelets guidance needed

    I have searched lot about facelets with eclipse . But i got application with NetBean.
    If any one having application or guidance.
    How to make web application through facelets in eclipse.
    Please guide me
    Regards
    Naresh Vatsal

    Either do it by hand (plain Eclipse is enough) or you might try JBossTools or some Redhat Developer Studio or some other Eclipse extension (I think MyEclipse also has some support).
    For facelets itself use the facelets user-documentation from the facelets website and the book "Facelets Essentials" from Bruno aranda and Zubin Wadia

  • Question about context in which Facelets runs

    I am converting my application from JSF-over-JSP to Facelets and it is going really well so far. The Netbeans template set up a Facelet's template for me with a starter-set CSS reference that looks like this:
    <link href="./css/default.css" rel="stylesheet" type="text/css" />
    <link href="./css/tableLayout.css" rel="stylesheet" type="text/css" />This works the way you would expect. However, when I create client facelets in a subdirectory and use the template in the root directory, the hrefs are broken because they are evaluated relative to the subdirectory, not where the template is located. Changing the references to this:
    <link href="/css/default.css" rel="stylesheet" type="text/css" />
    <link href="/css/tableLayout.css" rel="stylesheet" type="text/css" />Doesn't work. What does work is this:
    <link href="/MyApp/css/default.css" rel="stylesheet" type="text/css" />
    <link href="/MyApp/css/tableLayout.css" rel="stylesheet" type="text/css" />Although this works it strikes me as poor practice because if this application is deployed in a container as something other than "MyApp" the references will be broken again. Is that correct and if so, is there a better way of handling this?

    >
    Why not simply use this :
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    That's pretty much what I started with; isn't "./css" pretty much the same as "css"?
    What I was trying to avoid was replicating the css subdirectory in all the subdirectories that use it. My structure is:
    /template.xhtml (has CSS references in it)
    /home.xhtml (refers to /template.xhtml)
    /css/default.css
    /user/somepage.xhtml (also refers to /template.xhtml).I don't want to add
    /user/css/default.cssbecause the file is redundant. (in my app uses one stylesheet set for all pages).

  • Having trouble with including JNI library in netbeans

    [Sorry a newbie question - I am more used to writing large amounts of Solaris kernel and writing a JNI for the first time]
    Guys,
    I have a C library that needs to hook into the Java bean. I created a JNI library wrapper around the C library using swig/javah
    and that went fine (using some of the examples/ref in this forum). The JNI library contains classes like SysInfoJNI created
    by swig.
    class SysInfoJNI {
    public final static native int NAME_LEN_get();
    public final static native int NAME_LEN_set();
    I quickly wrote a standalone test program where I did
    public class test {
    // Load JNI Library
    static {
    System.loadLibrary("SysInfo");
    public static void main(String[] args) {
    SysInfoJNI siJNI = new SysInfoJNI();
    I can compile and run this on command line doing
    javac *.java
    java -Djava.library.path=./ Sysinfotest
    and it all works fine. Now I move this code to netbeans since I need to add some more code
    and create a java->web project and pretty much transfer the code there. I add the libSysinfo.so
    using the property->library->create option but netbeans still can't see the symbols coming
    out of Sysinfo JNI library. I suspect it wants the class definitions. My question is how do I
    supply that? swig didn't really crate a header file but it did create Sysinfo.java file. Do I
    just copy Sysinfo.java in the src directory (ugly?) or is there a convention of keeping the
    *.java files in some standard place (like /usr/include for C headers) and then what would be
    the method to include SysInfo.java to my netbeans src so that symbols can be found.
    Thanks,
    Sunay

    OK, seems like I had some kind of mismatch between the library & classes.
    The loadLibrary only had the name and I had the library in /usr/lib. After running
    truss -f -t open /usr/tomcat6/bin/startup.sh >& tomcat.out
    I could see the tomcat was finding the library but still reporting link error.
    Recompiling the library and classes again and then placing the library
    in /usr/lib and classes in the right directory resolved the issue.
    So I guess the answer to my original question is that classes need to
    be delivered as a jar along with the rest of the distribution while the
    library can be delivered in /usr/lib as part of the system.
    Appreciate the help and quick responses.
    Sunay

  • Authorization with JAAS in JSF with facelets

    hi,
    can u please hint me where i did mistake.. i clearly mention what i did and what i getting ..i did this in jsf1.2,tomcat6.x
    i did JAAS authentication in jsf with facelets.but i am unable to do the authorization with JAAS in jsf
    after getting authentication i put the subject in session. if i print the values in suject i got the following out put
    Subject:
    Principal: TypedPrincipal: hari [USER] // user name
    Principal: TypedPrincipal: admin [GROUP] // user role.
    now i want to authorization based on the role.
    for this i wrote policy file --principal.policy like this
    grant Principal com.alw.reports.jaas.TypedPrincipal "admin" {
        permission com.alw.reports.jaas.ViewIdPermission "*";
    grant Principal com.alw.reports.jaas.TypedPrincipal "hari" {
        permission com.alw.reports.jaas.ViewIdPermission "*";
    grant Principal com.alw.reports.jaas.TypedPrincipal "user" {
        permission com.alw.reports.jaas.ViewIdPermission "/contents.jsp";
    };and i set the path for this policy file like
                  System.setProperty("java.security.policy", "policy file location" );when i run my application i am getting login page after that i gave username and passwed. it is getting authentication .. but not able to displaying next page that is /pages/welcome.xhtml but directly it is showin /pages/error.xhtml
    i am getting following error
    java.security.AccessControlException: access denied (com.alw.reports.jaas.ViewIdPermission /pages/welcome.xhtml)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at com.alw.reports.jaas.JAASHelper$1.run(JAASHelper.java:87)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Unknown Source)
         at com.alw.reports.jaas.JAASHelper.permitionToAccessViewId(JAASHelper.java:83)
         at com.alw.reports.jaas.JAASActionListener.processAction(JAASActionListener.java:65)
         at javax.faces.component.UICommand.broadcast(UICommand.java:106)
         at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
         at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
         at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
         at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
         at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         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:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    my faces-config.xml
    <navigation-rule>
              <display-name>pages/login</display-name>
              <from-view-id>/pages/login.xhtml</from-view-id>
              <navigation-case>
                   <from-outcome>loginSuccess</from-outcome>
                   <to-view-id>/pages/welcome.xhtml</to-view-id>
              </navigation-case>
         </navigation-rule>
    <navigation-case>
                   <from-outcome>errorpage</from-outcome>
                   <to-view-id>
                        /pages/error.xhtml
                   </to-view-id>
              </navigation-case>my command button in login.xhtml
                             <td align="center" colspan="2">
                                  <h:commandButton value="Reset" type="reset"/>
                                  <h:commandButton   action="loginSuccess"
                                       id="login" value="Login" />
                             </td>my actionlister
    package com.alw.reports.jaas;
    import javax.faces.component.UIOutput;
    import javax.faces.context.FacesContext;
    import javax.faces.event.AbortProcessingException;
    import javax.faces.event.ActionEvent;
    import javax.faces.event.ActionListener;
    import javax.security.auth.Subject;
    public class JAASActionListener implements ActionListener   {
         private ActionListener parent = null;
         public JAASActionListener(javax.faces.event.ActionListener parent) {
              System.out.println("-------------- in JAASActionListener ;");
           this.parent = parent;
         public void processAction(ActionEvent event)
           throws AbortProcessingException {
              System.out.println("-------------- in processAction ;");
           FacesContext context = FacesContext.getCurrentInstance();
           UIOutput comp = null;
           String userid = null, password = null;
           JAASHelper jaasHelper = new JAASHelper();
           // Check to see if they are on the login page.
           boolean onLoginPage = (-1 != context.getViewRoot().getViewId().lastIndexOf("login")) ? true : false;
           if (onLoginPage) {
             if (null != (comp = (UIOutput)
               context.getViewRoot().findComponent("helloForm:username"))) {
               userid = (String) comp.getValue();
             if (null != (comp = (UIOutput)
               context.getViewRoot().findComponent("helloForm:password"))) {
               password = (String) comp.getValue();
             // If JAAS authentication failed
             if (!jaasHelper.authenticate(userid, password)) {
               context.getApplication().getNavigationHandler().handleNavigation(context, null, "login");
               return;
             else {
               // Subject must not be null, since authentication succeeded
                  System.out.println("----------- setting the subjects in context in  ActionListner ");
               assert(null != jaasHelper.getSubject());
               // Put the authenticated subject in the session.
               System.out.println("---- putting the authenicated subject in the seesion ");
               context.getExternalContext().getSessionMap().put("JAASSubject",jaasHelper.getSubject());
           parent.processAction(event);
           Subject subject=(Subject)context.getExternalContext().getSessionMap().get("JAASSubject");
          System.out.println("subject after parent process action>>>>>>>>>>>>>>>>>>>>>"+subject);
          assert(null != subject);
          if(!jaasHelper.permitionToAccessViewId(subject,context,context.getViewRoot().getViewId())){
              context.getApplication().getNavigationHandler().handleNavigation(context, null, "errorpage");
    }can u please hint me where i did mistake
    thanks in advance

    gbabu wrote:
    My doubt is based on that subject , how to write policy file and how to call doAsPrivileged() mehod on that Subject in order to navigate web pages.how to provide web pages permission for particular role in policy file..
    For example i have three pages login.xhtml,user.xhtml,admin.xhtml.
    1> if the logged in person is admin, then we want to display admin.xhtml
    2> if the loggend is person is user , then we want to display user.xhtml
    untill now i did and found who is logged in and what are his type( admin or user) .now i want configure the web.xml and faces-config.xml based on policy fileTo the best of my knowledge, there is nothing in the standard NavigationHandler which accounts for JAAS security. If you wanted, you could create a custom NavigationHandler to do this. If you think the idea is worthy enough, you could issue an enhancement request to the specification ([https://javaserverfaces-spec-public.dev.java.net/]).

  • Application working under NetBeans but not as a *.jar file

    Hello,
    recently I found a little problem. I wrote application that shows all available ports in my computer. When I am running this applications under NetBeans it works with no problem - finds all available ports. Then I am building it to the *.jar file. Application is working with no problem but command:
    Enumeration PortIds = CommPortIdentifier.getPortIdentifiers();
    is not returning any identifiers - PortIds is empty.
    Anyone knows a solution for this type of problems? Thanks

    Hi Venkatesh,
    Few questions.
    1. What is your JDeveloper version? (Always better to post your JDev version along with the question, which would help us to help you better).
    2. Did you try adding webserviceclient.jar to the classpath? (Search in your JDev installation directory for the location of this jar file).
    -Arun

Maybe you are looking for

  • Problem in developing a simple ejb app

    Hi readers, i am new to ejb technology, so have doubt in developing and deploying a simple ejb application i am using EJB 2.0, JBOSS 4.0 , eclipse 3.2 and java 1.5 i searched in the net , got through many materials that can guide to develop one of it

  • How to use interactive internal report in alv

    hey expert i want to know who i will used interactive internal report in alv report by various tables in my one assingment. They have told us to do the various steps which i was giving down: 1) In first step they have told me to use of call transacti

  • Error 1 on multi file extract

    hello im trying to extract a multi part zip file (zip.001 zip.002 etc.) and when ever i try and do it i get a message that says "error 1" screenshot -> http://b.imagehost.org/0289/Picture_1.png ive tryed this other accounts on my mac and i get the sa

  • Accessing WindowsAdminServerGroup

    Hello everyone, Can any one give me a solution on... Is there a way to access the Windows Admin Server Group (LAN Admin Group) from the Java Application(Jsp, Servlets, JDBC, or some other means)? Are there any JavaApi for this (or) are there any 3rd

  • Error when create Infotype 0007-Planned Working Time of Personnel data

    Hi Experts, I'm creating Infotype 0007-Planned Working Time for Personnel data then having a error below.( I created Work schedule rule and Gennerated it). Feature structure cannot be recognized, please see documentation Message no. P0568 Diagnosis C