Results 1 to 4 of 4
  1. #1
    vector_ever is offline Senior Member
    Join Date
    Jul 2013
    Posts
    188
    Rep Power
    6

    Default @ViewScoped beans are not supported on stateless views

    Hello,

    I have problem where i got always warning message
    XML Code:
    @ViewScoped beans are not supported on stateless views
    @ViewScoped beans are not supported on stateless views
    I tried to change the scope of my managed bean (Session, View , or Request) but still have warning message
    I define the problem in my JSF page:

    XML Code:
    <?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:h="http://java.sun.com/jsf/html"
          xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
          xmlns:f="http://xmlns.jcp.org/jsf/core"
          xmlns:p="http://primefaces.org/ui">
    
        <f:metadata>
            <f:viewParam name="id" value="#{mitarbeiter.id}"/> 
        </f:metadata>
    
        <f:view locale="#{langSwitcher.locale}" transient="true">
    
            <h:head>
            </h:head>
    
            <h:body>
              JSF EL in the body
            </h:body>
        </f:view>
    </html>
    If i deploy my code it will work perfectly, but i used pretty face to redefine the URL so in WEB-INf--->pretty-config.xml
    XML Code:
        <url-mapping id="einzelMitarbeiter">
            <pattern value="/mitarbeiter/#{id}" />
            <view-id value="/einzelMitarbeiter.xhtml" />
        </url-mapping>
    any way when i deploy it again i get the warning message

    It is obvious that because i have view tag in my JSF page
    1- <f:viewParam name="id" value="#{mitarbeiter.id}"/>
    2- <f:view locale="#{langSwitcher.locale}" transient="true"> which if i delete it will get no more such warning message, but i need it so still have the problem

    Any suggestion ?

  2. #2
    Join Date
    Apr 2014
    Location
    http://www.roytuts.com
    Posts
    51
    Rep Power
    0

    Default Re: @ViewScoped beans are not supported on stateless views

    when you are using jsf 2 then why do you use <f:view/>

  3. #3
    vector_ever is offline Senior Member
    Join Date
    Jul 2013
    Posts
    188
    Rep Power
    6

    Default Re: @ViewScoped beans are not supported on stateless views

    Quote Originally Posted by itswebin@gmail.com View Post
    when you are using jsf 2 then why do you use <f:view/>
    What the wrong with <f:view/> tag ??

    Which alternative have i to use instead of?

  4. #4
    Join Date
    Apr 2014
    Location
    http://www.roytuts.com
    Posts
    51
    Rep Power
    0

Similar Threads

  1. sensible difference between Stateless and Stateful Beans
    By voipp in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 05-27-2014, 11:02 PM
  2. MVC - have 2 Views but only 1 updates
    By equal in forum AWT / Swing
    Replies: 2
    Last Post: 05-21-2011, 12:26 AM
  3. Relation between 2 views
    By tojas in forum SWT / JFace
    Replies: 0
    Last Post: 04-19-2009, 03:22 AM
  4. How to make Beans Lazily-instantiating beans
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-30-2008, 10:10 AM
  5. How to make Beans Lazily-instantiating beans
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 09-26-2007, 08:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •