facebook

MyFaces setup not quite working…

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #232827 Reply

    donw1128
    Member

    Hi All,

    I’m fairly new to MyEclipse and JSF, but have been gradually getting things working fairly well. So I decided I’d like to try MyFaces, and started with the inputCalendar component.

    I created a new web project, selected “Add JSF Capabilities…”, chose “MyFaces 1.09″, and clicked finish. Then I created a simple .jsp page and added the following:

    <%@ taglib uri=”http://myfaces.apache.org/extensions&#8221; prefix=”x”%>
    .. other stuff ..
    <h:form id=”myform”>
    <x:inputCalendar id=”rt_date_from” value=”#{bean.fromDate}”
    renderAsPopup=”true”/>
    </h:form>

    and add the ‘bean’ of course. When I deploy and open the page, I get a Javascript error but the control renders fine. When I click on the “…” button, I get another Javascript error. Looking at the HTML source, it seems that the Javascript function jscalendarPopUpCalendar is called, but nothing on the page appears to load or define that function.

    Looking in the myfaces-extensions.jar, I found the script. But why isn’t it being loaded in the page? What step am I missing to get things to work?

    Thanks for the help.
    Don

    #232830 Reply

    donw1128
    Member

    BTW: I’m using the latest stuff (maybe that is the problem):

    Tomcat 5.5
    JDK 1.5
    Eclipse 3.1
    MyEclipse 4.0M2

    Thanks,
    Don

    #232844 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev.

    Don since you are using a MyFaces custom component I would direct you to their forums, not because we don’t want to help, but because we have no idea. none of us have used those tags before, so I don’t know what is required of you to get them working.

    #232905 Reply

    donw1128
    Member

    Thanks for the suggestion Riyad.

    I posted the question on the MyFaces user list, and got a quick reply. The myfaces extensionFilter is needed in the web.xml. Perhaps MyEclipse should be automatically adding this when a new MyFaces based project is created? Here are the lines I added:

    
        <!-- Extensions Filter -->
        <filter>
            <filter-name>extensionsFilter</filter-name>
            <filter-class>
                org.apache.myfaces.component.html.util.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>
            <!--        <init-param>
                <param-name>uploadRepositoryPath</param-name>
                <param-value>/temp</param-value>
                <description>Set the path where the intermediary files will be stored.
                </description>
                </init-param>-->
        </filter>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>*.faces</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <url-pattern>/faces/*</url-pattern>
        </filter-mapping>
    

    Thanks,
    Don

    #232921 Reply

    Riyad Kalla
    Member

    Don thank you very much for posting your findings, I’ll file this as I think you have a very good point.

    #233881 Reply

    Fleep
    Member

    Hi,

    I encounter the same problem as you.
    I test your solution, but nothing, I have always the javascript error. What can I do ?

    I don’t use MyEclipse, but I think it’s not a necessary.
    I try also to subscribe to the MyFaces user list, but, my mail is always return with mailer-daemon.

    Thanks for help.

    #233901 Reply

    donw1128
    Member

    I don’t have a clue why it is not working for you. Perhaps something else is missing in either your web.xml or faces-config.xml file.

    But in order to send mail to the myfaces discussion group, you must subscribe. Go to the page:

    http://myfaces.apache.org/mailinglists.html

    and click the Subscribe link for the “users at myfaces.apache.org” line. This will send a blank e-mail to subscribe you. At that point you should get a confirmation e-mail which you must reply to to fully subscribe.

    Don

    #233913 Reply

    Fleep
    Member

    Ok, I didn’t see that the web site of MyFaces has move to this address.

    In my web.xml, I add what you have write just before.
    But, in the faces-config.xml, I do nothing.

    This file is the definition or your own component so I thought there is nothing to write here. Is it wrong ?

    Thanks for your help.

    #233920 Reply

    donw1128
    Member

    Are you using any IDE? There are so many things to set up for JSF that it really helps to have a tool that creates the initial JSF project at least.

    If you are using a different tool than MyEclipse, it should have set everything else up for you, and all you need to add is the above definitions.

    Don

    #234005 Reply

    Fleep
    Member

    No, I don’t use any for create the initial JSF Project.

    I have just Eclipse, Jboss, JDK, etc…

    Have you something in your faces-config ?

    #234021 Reply

    donw1128
    Member

    I have lots of things in my faces-config.xml file ;-] but nothing that pertains to MyFaces.

    So assuming that you had created a working JSF application to start with, and then added the lines above to your web.xml, I have no idea why things are not working for you.

    Did you also setup the Faces ConfigureListener in your web.xml?

    
    <listener>
      <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    

    Don

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: MyFaces setup not quite working…

You must be logged in to post in the forum log in