[JBoss Portal] - setPortalMode not working
by PeterJ
I have a portlet implemented using JSPs. I would like, when the edit mode is displayed, when the user clicks the Submit button on the edit page, that the view page of the portlet gets displayed. I tried using the PortletURL.setPortletMode() method, which is supposed to add a mode change parameter to the URL, but that is not working (I did check the URL generated and it appears to be correct with a "mode=edit" parameter), the edit page is displayed again.
Here is what is in my doEdit method:
PortletURL urlSubmit = response.createActionURL();
| urlSubmit.setPortletMode(PortletMode.VIEW);
| request.setAttribute("submit", urlSubmit.toString());
And in my JSP I have:
<form action="${submit}" method="post">
According to the log, the URL is:
/portal/auth/portal/default/default/ImagePortletWindow?action=5&mode=view
I looked at the source for GenericPortlet.doDispatch, which lead me to PortletRequestImpl.getPortletMode, which appears to be getting the current mode from the context. Unless the context was supposed to be changed earlier as part of the request processing, shouldn't PortletRequestImpl check if the mode appears among the requests parameters?
JBoss AS 4.0.4.GA, JBoss Portal 2.4.0.CR3, Sun JDK 1.5.0_06
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963955#3963955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963955
19 years, 9 months
[JNDI/Naming/Network] - When JBoss 4.04 injects a bean into JNDI, how does it choose
by SmokingAPipe
Here's my question:
I have some Stateless Session Bean classes. This is a very simple applications which lets users leave their names and phone numbers so a salesman can contact them later. To do this, I have set up an Inquiry entity bean.
I also have a stateless session bean called InquiryManagerBean. There is an InquiryManagerBean interface like this:
| @Local public interface InquiryManagerBean {
|
| /** Create a new persistent Inquiry instance */
| public Inquiry create(Inquiry toCreate);
| }
|
And then a class which implements it:
| @Stateless public class InquiryManagerBeanLocal implements InquiryManagerBean {
|
| @PersistenceContext EntityManager entityManager;
|
| /** Creates a new instance of InquiryManagerBeanLocal */
| public InquiryManagerBeanLocal() {
| }
|
| public Inquiry create(Inquiry toCreate) {
| if(entityManager == null) {
| logger.severe("No entity manager was found in " +
| "this persistence context! Nothing will work.");
| return null;
| }
| if(toCreate == null) return null;
| entityManager.persist(toCreate);
| return toCreate;
| }
|
| }
|
Now I have a servlet that needs to get this InquiryManagerBean so it can persist inquiries, etc. It looks it up like this:
| InitalContext context = new InitialContext();
| InquiryManagerBean inquiryManagerBean =
| (InquiryManagerBean) context.lookup("MyApplicationName/InquiryManagerBeanLocal/local");
|
My question is, this does not make sense. Shouldn't I be looking the bean up as "MyApplicationName/InquiryManagerBean/local"? The servlet is getting an interface which is not necessarily an instance of the actual InquiryManagerBeanLocal class. All it knows about or cares about is that the object it gets implements InquiryManagerBean.
So, am I doing something wrong, or?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963953#3963953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963953
19 years, 9 months