If an error happens, you need to configure the render parameters in the processAction for the next render (hence doView) method, such as:
| resp.setParameter("error", "My Error Message");
|
Then in doView you can do:
| String error = req.getParameter("error");
| if (error != null)
| {
| displayError(error);
| }
| else
| {
| // Normal treatment
| }
|
Of course the down side of this way to do is that the error message will happen on every render of the portlet until the user clicks on one link of the portlet that will change the render parameters.
If you want to void that then you should store the error message in the PortletSession and remove it from the session during the render.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061649#4061649
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061649
Hi,
I want to try a very basic validation on an input text field which name is "value"
This is my stateful bean
| ....
|
| public void sayHello()
| {
| facesMessages.add("hello #{hello.value}");
| }
|
|
|
| @Length(max=10)
| public String getValue()
| {
| return value;
| }
|
| ......
|
And the jsf part
| <h:inputText id="value" required="true"
| value="#{hello.value}">
| <s:validate/>
| </h:inputText>
|
| <h:message for="value"/>
|
If I don't fill the input, I have a "value is required" message, which is expected as I set required="true".
But if the value is more than 10 characters long, I have no errors, however I put the annotation @Length(max=10).
So what did I miss ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061648#4061648
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061648
I'm running up against the same issue. My passwords are stored SHA hashed in the database, and so I need to hash the clear text password to compare it with the hashed password fetched from the db. When I attempt to hash #{identity.username}, it simply hashes the String "#{identity.username}".
How does one get the evaluated EL value from #{identity.username} so it can be hashed before placing it into a query parameter? Is there another way to compare the hashed values?
Thanks in advance,
Tom
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061645#4061645
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061645