You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by yao cuihong <ya...@gmail.com> on 2006/01/27 14:32:32 UTC

Jsp to portlet application

Hello, everyone.

I have a web application based on jsp (all is jsp, no java bean). I want to
upgrade it to portlet application based on Jetspeed 2.0.How to use the old
jsp(all business logic is in these jsp)? DoI hava to rewrite the business
logic or jsp in the new portlet application?

Thanks for any help.

Re: Jsp to portlet application

Posted by swee heng <sw...@gmail.com>.
>From my understanding of portlet, everytime when a actionURL event is being
fired, the processAction method will triggered followed by the doView
method. Therefore, i personally preferred to put my business logic inside
the doView method and then dispatch to the respective JSP pages to handle
the view. In this case, all my business logic are in java classes which I
will used in my portlet. Is there a more effective way to what I am doing
now?

  public void doView(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)throws PortletException, IOException{
    ...
    BusinessLogicClass blc = new BusinessLogicClass();
    ...

getPortletConfig().getPortletContext().getRequestDispatcher("/helloworld.jsp").include(request,
response);
  }

On 2/8/06, mu baosen <mu...@gmail.com> wrote:
>
> >
> > Thanks for replying.
>
>
>    I have write a lot of code in b.jsp. Should I move them to the
> processAction method of the portlet class? Should all requests in my
> application be handled by the portlet class? If I have a lot of jsps, how
> can I know that which jsp the request was sent by ?
>
>    Regards,
>    Mubaosen
>
>


--
Best Regards
Will

Appxolute 4D Support
Appxolute Pte Ltd
Contact: +65 6339 6789
Fax: +65 6399 2576
http://www.appxolute.com

Re: Jsp to portlet application

Posted by mu baosen <mu...@gmail.com>.
There are lots of <jsp:forward> directives in my jsps. Should these
<jsp:forward> directives be modified?How to handle these directives?

Thanks.

Re: Jsp to portlet application

Posted by mu baosen <mu...@gmail.com>.
> Thank you very much.
>
>

Re: Jsp to portlet application

Posted by Aaron Evans <aa...@yahoo.ca>.
mu baosen <mubaosen <at> gmail.com> writes:

> 
> >
> > Thanks for replying.
> 
>    I have write a lot of code in b.jsp. Should I move them to the
> processAction method of the portlet class? Should all requests in my
> application be handled by the portlet class? If I have a lot of jsps, how
> can I know that which jsp the request was sent by ?
> 
>    Regards,
>    Mubaosen
> 

It is generally good practice to handle the business logic outside of the JSP
view.  So yes, in the processAction method.  That being said, you don't *have*
to do this.

But, one thing to be aware of is that your JSP code will be executed everytime
the portal page is rendered, even if the current request is targetting a 
different portlet on the same page.  This could mean for example that you will
place unnecessary additional load on a backend database or other resources.

HTH,
aaron


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jsp to portlet application

Posted by mu baosen <mu...@gmail.com>.
>
> Thanks for replying.


   I have write a lot of code in b.jsp. Should I move them to the
processAction method of the portlet class? Should all requests in my
application be handled by the portlet class? If I have a lot of jsps, how
can I know that which jsp the request was sent by ?

   Regards,
   Mubaosen

Re: Jsp to portlet application

Posted by swee heng <sw...@gmail.com>.
this is how i defined my form action:

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects />

<form action="<portlet:actionURL />">
...
</form>

On 2/8/06, Ate Douma <at...@douma.nu> wrote:
>
> yao cuihong wrote:
> >>David
> >
> >
> >    Thank you.
> >    Should each action of form in my jsp be modified? For example, a.jspas
> > following:
> >    <form action="b.jsp">
> >       <input type="text">
> >       <input type=submit>
> >    </form>
> >    Shoule the action property(b.jsp) of the form be modified?
> Yes.
> Please, spend some time reading up on Portlets and the Portlet API
> (JSR-168) ...
>
> >
> >    Thanks.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>


--
Regards,
SweeHeng

Re: Jsp to portlet application

Posted by Ate Douma <at...@douma.nu>.
yao cuihong wrote:
>>David
> 
> 
>    Thank you.
>    Should each action of form in my jsp be modified? For example, a.jsp as
> following:
>    <form action="b.jsp">
>       <input type="text">
>       <input type=submit>
>    </form>
>    Shoule the action property(b.jsp) of the form be modified?
Yes.
Please, spend some time reading up on Portlets and the Portlet API (JSR-168) ...

> 
>    Thanks.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Jsp to portlet application

Posted by yao cuihong <ya...@gmail.com>.
>
> David

   Thank you.
   Should each action of form in my jsp be modified? For example, a.jsp as
following:
   <form action="b.jsp">
      <input type="text">
      <input type=submit>
   </form>
   Shoule the action property(b.jsp) of the form be modified?

   Thanks.

Re: Jsp to portlet application

Posted by David Sean Taylor <da...@bluesunrise.com>.
yao cuihong wrote:
> Hello, everyone.
> 
> I have a web application based on jsp (all is jsp, no java bean). I want to
> upgrade it to portlet application based on Jetspeed 2.0.How to use the old
> jsp(all business logic is in these jsp)? DoI hava to rewrite the business
> logic or jsp in the new portlet application?
> 
> Thanks for any help.
> 
The main issue is your URLs. You will have to use the portlet tag 
library to make your URLS point back to the portal. Some frameworks have 
abstracted the URL generation code (in fact that is much of what Bridges 
does) to help developers write applications that run both in servlets 
and portlets.

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org