• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2EE Application to Portlet

 
Tushar Kherde
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All Ranchiens,

I have a query regarding Migrating J2ee application to Portlet.

I have J2EE Application. I just want to show the interface layer on the portal and want to show the output to the portal.

I just wanted to know what are the different way to do this.

Thanks in advance!
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What server are you running on?

One way is to just write a new interfac using the JSR168 APIs, and JSPs. The JSPs/Portlet can simply call your back end J2EE resources like your old Servlet/JSP application did. Should'nt be much of a problem.

If you're real lazy, you can web clip, which clips existing content into a portlet.

One big direction is JSF. If you have a JSF app, or create a JSF app, they can be wrapped quite easily using a JSF to Portlet Bridge.

Those are a few options.

-Cameron McKenzie
 
Jimmy Ho
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with the prior post. You can just use a web clipper or iFrame. Not ideal, but works with minimal work.

However, if you want to actually migrate your application into Portal, then read on...

If your application is a very simple J2EE web application, then you just have to combine all your servlets into the portlet class (which is Portal's version of the 'servlet'). Then you have to consider what happens when your portal page refreshes but does not perform an action on that portlet. That is, the difference between "doView()", and "actionPerformed()".

Generally speaking, if you followed good MVC principles, then it's not horrible. However, if, for example, you put in code that updates a database in a JSP file, then you might be in trouble, because when Portal refreshes a page, it will execute that JSP again purely to re-display that portlet, and that can cause problems.

Most importantly, if you used an MVC framework or special libraries, then you'll have to evaluate if they are compatible with Portal. JSF integration is pretty straightforward on WebSphere Portal, so it won't be too painful, but the documentation on how to do it is scarce. Struts and Tiles migration into WebSphere Portal is well-documented, and probably won't take long (days, not weeks, for a reasonable-size app). JSTL is completely supported in WebSphere Portal, so that shouldn't be a problem either. Struts-EL, well, that's going to require some hacking... And so on... (by the way, all of this assumed WebSphere Portal 5.1.0.1 or later).

Lastly, watch out for namespace-encoding issues. This usually happens if you use a lot of JavaScript. Now that the web app does not own the whole webpage, global-scope JavaScript variable and function names will conflict with portal's names, and also with names defined by other portlets. Common ones include JavaScript functions named "submit()" or "submit_form()", etc. Watch out for DHTML/JavaScript interactions that depend on element names in the HTML. If two portlets both use the name "inputForm" for a form tag, and they appear on the same page, you're in trouble.


Generally, speaking, I've found that the back-end stuff hardly every changes in Portal. Once you're in the back-end code, you're usually back in 'normal' J2EE stuff, with a JVM, a container that's got most of what you had before Portal. But the front-end stuff requires a lot of analysis, and work.

Don't get me started on how many people take a web application and shove it into a portlet without considering the consequences from a graphic design/screen space usage perspective...
[ August 21, 2007: Message edited by: Jimmy Ho ]
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amen, Jimmy.

-Cameron McKenzie
 
Tushar Kherde
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton Cameron and Jimmy.
Cameron,
The application is running on WebSphere 5.1.
[ August 25, 2007: Message edited by: Tushar Kherde ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic