I have been using JSF (MyFaces) with PrettyFaces for a while. Everything works perfectly, excepting POST requests.
The only problem I have is that I can’t make POST requests to any of the pages that are rewritten by PrettyFaces. I would really appreciate your help, because it’s a show stopper.
pretty-config.xml
<url-mapping id="market-view-item">
<pattern value="/market/#{viewItem.itemId}" />
<view-id value="/market/view-item.xhtml" />
</url-mapping>
pom.xml
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>2.0.5.Final</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-prettyfaces</artifactId>
<version>2.0.5.Final</version>
</dependency>
I used 2.0.4.Final
until today. I hoped that it will work by upgrading to 2.0.5, but nothing.
web page form:
<h:form prependId="false">
<p:inputTextarea rows="3" style="width:450px; margin:5px 0;" autoResize="false"/>
<h:commandButton action="#{test.doSomething}" class="pg-button" value="Add comment"/>
</h:form>
CDI bean:
@Named("test")
@RequestScoped
public class TestB {
public void doSomething() {
System.out.println("I work.........");
}
}
Any ideas why POST requests are not executed? Whatever I do, they just don’t happen. No error at all. Just nothing.
When I press the submit (Add comment
) button, Chrome makes a request (ajax / non-ajax (I tried both)), but method doSomething
is not triggered.
I tried withing bean viewItem
also (the one specified in pretty config), but nothing. I tried in 100 ways…
I have to mention that all pretty faces config mappings work perfectly on GET requests, just that I can’t post from them.
I couldn't find any solution/answer to this until now.
I would really appreciate any help.
Thanks a lot!