PrettyFaces传递变量。怎么解决?

时间:2021-02-14 22:32:54

I spent a lot of time but I can't fix what exacly I do wrong with PrettyFaces configuration. I have the following rule in pretty-config.xml:

我花了很多时间,但我无法解决我对PrettyFaces配置的错误。我在pretty-config.xml中有以下规则:

<url-mapping id="administrator_comments"> 
      <pattern value="/comments/{someVariableName}" /> 
      <view-id value="/faces/backend/comments/comments" />
</url-mapping>

and now I would like to test this using following url:

现在我想使用以下url测试它:

http://localhost:8080/myapplication/comments/test

and I get 404 NOT FOUND. What am I doing wrong? I tried everything but can't understand why that happens. I am doing exactly the same PrettyFaces examples.

我得到了404 NOT NOT FOUND。我究竟做错了什么?我尝试了一切但却无法理解为什么会这样。我正在做同样的PrettyFaces例子。

1 个解决方案

#1


You are missing the # character for the EL expression and the file extension of your view. Try:

您缺少EL表达式的#字符和视图的文件扩展名。尝试:

<url-mapping id="administrator_comments"> 
  <pattern value="/comments/#{someVariableName}" /> 
  <view-id value="/faces/backend/comments/comments.xhtml" />
</url-mapping>

#1


You are missing the # character for the EL expression and the file extension of your view. Try:

您缺少EL表达式的#字符和视图的文件扩展名。尝试:

<url-mapping id="administrator_comments"> 
  <pattern value="/comments/#{someVariableName}" /> 
  <view-id value="/faces/backend/comments/comments.xhtml" />
</url-mapping>