One of the best examples of how to work struts with JSR168 portlets is the sourcecode for LifeRay.
> -----Original Message----- > From: Karan [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 16, 2005 10:07 AM > To: ML Struts > Subject: Struts Portlets, jBoss Portal > > Has anyone transferred their Struts application to run as a > JSR168 portet in jBoss Portal?? > I am using jBossAS 4.0.1sp1 and jBoss Portal v2.0. > > Whats confusing me is this: In struts, every action defines > the html/jsp/freemarker etc page that should be displayed. on > the user's screen. > However, to display something in a portlet, it should be > called inside the doView() function of the portlet, > > This statement is in the doView() function of my portlet's class: > ...... > PortletRequestDispatcher rd = > getPortletContext().getRequestDispatcher("/main.do"); > ...... > > My struts-config: > .... > <action path="/main" > type="portlet.mote.beans.MainAction"> > <forward name="success" path="/FTLs/main.ftl"/> > </action> > <action path="/trial" forward="/FTLs/trial.ftl"/> > ..... > > The above scenario displays the content of main.ftl in the > portlet's window, just like it should, i.e. the portlet > called main.do, and whatever main.do returns (main.ftl) is > sent to the portlet to be displayed. But, when I put a link > in main.ftl which points to another action, (say, trial.do): > My main.ftl: > <#assign html=JspTaglibs["/WEB-INF/struts-html.tld"]> > <#assign bean=JspTaglibs["/WEB-INF/struts-bean.tld"]> > This is main.ftl in stack2.war. > If you see this, it means basic Struts action-mapping is working. > <p><@html.link action="trial.do">Show Trial</@html.link></p> > > When I click on the "Show Trial" link on main.ftl, the > application leaves the portal and shows the content of > trial.ftl on the browser (no portal/portlets, just trial.ftl). > How do I make sure that whatever I do in struts stays inside > the portlet window? > > Regards, > Karan > -- > CM II > Resolution Systems Inc. > /-- never compromise. what if you compromise and lose? --/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]