[solved] Action error in pretty config xml
Splash › Forums › PrettyFaces Users › [solved] Action error in pretty config xml
This topic contains 6 replies, has 4 voices, and was last updated by CarMonahan 1 month, 1 week ago.
-
AuthorPosts
-
September 7, 2010 at 9:16 pm #17780
Hi,
Just now I installed Pretty faces in my application. I am configuring pretty config xml I was getting the following error:
cvc-complex-type.2.4.a: Invalid content was found starting with element ‘query-param’. One of ‘{“http://ocpsoft.com/prettyfaces/3.1.0”:action}’ is expected.
[/CODE]and my code is
[CODE]
<pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.0″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.0
http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd“><url-mapping>
<pattern value=”/faces/userHome” />
<view-id>/faces/user/userHome.faces</view-id>
<action>#{dashboardBean.handleReorder}</action>
<query-param name=”page”>#{dashboardBean.page}</query-param>
</url-mapping></pretty-config>
[/CODE]Thanks for your help in advance.
[CODE]
cvc-complex-type.2.4.a: Invalid content was found starting with element ‘query-param’. One of ‘{“http://ocpsoft.com/prettyfaces/3.1.0”:action}’ is expected.
[/CODE]
and my code is
<pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.0″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.0
http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd“><url-mapping>
<pattern value=”/faces/userHome” />
<view-id>/faces/user/userHome.faces</view-id>
<action>#{dashboardBean.handleReorder}</action>
<query-param name=”page”>#{dashboardBean.page}</query-param>
</url-mapping></pretty-config>
[/CODE]Thanks for your help in advance.
[CODE]
<pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.0″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.0
http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd“>
<url-mapping>
<pattern value=”/faces/userHome” />
<view-id>/faces/user/userHome.faces</view-id>
<action>#{dashboardBean.handleReorder}</action>
<query-param name=”page”>#{dashboardBean.page}</query-param>
</url-mapping>
</pretty-config>
[/CODE]
Thanks for your help in advance.
September 7, 2010 at 9:21 pm #20164query-param
should be placed immediately afterpattern
if I am not mistaken. Your code should still work, but it won’t validate unless the elements are in the right order.September 7, 2010 at 9:45 pm #20165Hi,
Thanks it worked. I am not getting the expected url. I was expecting
http://localhost:8080/mhealth250/faces/userHome?page=userHome
but I got the following url http://localhost:8080/mhealth250/faces/userHome.
and my configuration is
<pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.1.0″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.1.0
http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.1.0.xsd“>
<url-mapping>
<pattern value=”/faces/userHome” />
<query-param name=”page”>#{dashboardBean.page}</query-param>
<view-id>/faces/user/userHome.faces</view-id>
</url-mapping>
</pretty-config>
Thanks for your help in advance.
September 7, 2010 at 9:57 pm #20166How is the URL being accessed?
September 8, 2010 at 1:17 pm #20167Hi,
In the following way url being accessed.
http://localhost:8080/mhealth250/faces/userHome
Thanks,
September 9, 2010 at 5:47 am #20168This is expected behavior in this situation! When you access
/mhealth250/faces/userHome
with your browser, PrettyFaces will write the value of thepage
query parameter to the specified bean property. But as you don’t specified this query parameter, PrettyFaces will just render you view/faces/user/userHome.faces
.January 16, 2021 at 6:12 am #29716Finding errors with XML files is not only difficult but nearly impossible. The only way to get done is to send everything to papernow.org and explain what’s wrong. They will fix everything for you in reasonable time and minimum charges.
-
AuthorPosts
You must be logged in to reply to this topic.