[JBoss Portal] - ActionRequest.sendRedirect doesn't work properly
by saint_ua
My environment:
JBoss Portal Version: 2.6.1
I have downloaded binary files from JBoss site
JBoss AS Version: 4.2.1
Database Vendor and Version: PostgerSQL Server 8.1
OS Platform: Windows 2003 Server
Hello!
I have the followed problem ActionRequest.sendRedirect method not working on Portal 2.6.1 (On Jboss Portal 2.4.1 is everething OK). I have tried to run simple test. I have downloaded HelloWorldPortlet and have changed some code to test sendRedirect method. I have changed ONLY HelloWorldPortlet.java. Here is the source code:
package org.jboss.portlet.hello;
import javax.portlet.*;
import java.io.IOException;
import java.io.PrintWriter;
public class HelloWorldPortlet extends GenericPortlet
{
protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException, UnavailableException
{
rResponse.setContentType("text/html");
PrintWriter writer = rResponse.getWriter();
writer.write("Hello World!");
writer.write("<form name='form1' method='post' action='" + rResponse.createActionURL() + "'>");
writer.write("");
writer.write("");
writer.close();
}
public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, PortletSecurityException, IOException {
System.out.println("!!!!!!!!!!!!!!!!!!! redirecting to http://www.jboss.org" );
actionResponse.sendRedirect("http://www.jboss.org");
}
It's not working. After pressing submit button on HelloWorld portlet I have empty page with URL "http://localhost:8080/portal/portal/default/default/HelloWorldPortletWind...".
Please help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080504#4080504
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080504
18 years, 7 months
[JBoss Seam] - hibernate validator: how to access seam component
by amashtakov
Hi everybody,
There are two ejb-s:
- Account (entity)
Account {
...
@AccountLogin
public String getLogin() {...}
...
}
- AccountManager (session)
@Name("accountManager")
AccountManager {
...
public Account findByLogin(String login) {...}
...
}
In order to check if account with the same login already exists or not, I
developed a hibernate validator:
@ValidatorClass(AccountLoginValidator.class)
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface AccountLogin {
String message() default "the same login already exists";
}
I'm trying to inject "accountManager" component into AccountLoginValidator in order to perform check but with no
success - instance variable is always null:
@Name("accountLoginValidator")
public class AccountLoginValidator
implements Validator, PropertyConstraint {
@In(create=true, value="accountManager")
private AccountManagerLocal accountManager;
...
}
With jndi lookup everything works fine, but I'd like to use seam
injection facilities to get this reference.
In any way to do this ?
PS:
In page code bean I always get the reference to "accountManager"
without any problem using the same @In anotation.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080500#4080500
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080500
18 years, 7 months
[JBoss Portal] - Re: ClassCastException when using MyFacesGenericPortlet
by jaboj
OK, maybe the MyFacesGenericPortlet doesn't care about the Portal version, but nevertheless we get a ClassCastException when the MyFacesGenericPortlet attempts to get a handle to the FacesContext. The exception occurs in the facesContext method:
| protected FacesContext facesContext(PortletRequest request,
| PortletResponse response)
| {
| return facesContextFactory.getFacesContext(portletContext,
| request,
| response,
| lifecycle);
| }
|
In Portal 2.6 the facesContextFactory reference references an instance of com.sun.faces.context.FacesContextFactoryImpl and when the getFacesContext method is invoked on this factory object the ClassCastException occur.
In Portal 2.4 the facesContextFactore references an instance of org.apache.myfaces.context.FacesContextFactoryImpl. Is it possible to change the facesContextFactory implementation for our only application?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080498#4080498
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080498
18 years, 7 months