<action path="/ext/library/add_book" type="com.ext.portlet.library.action.AddBookAction">
<forward name="portlet.ext.library.view" path="portlet.ext.library.view" />
<forward name="portlet.ext.library.error" path="portlet.ext.library.error" />
<forward name="portlet.ext.library.success" path="portlet.ext.library.success" />
</action>
2.tiles-defs.xml
<definition name="portlet.ext.library.error" extends="portlet.ext.library">
<put name="portlet_content" value="/portlet/ext/library/error.jsp" />
</definition>
<definition name="portlet.ext.library.success" extends="portlet.ext.library">
<put name="portlet_content" value="/portlet/ext/library/success.jsp" />
</definition>
=============================
And create these JSP files:(location : /ext/ext-web/docroot/html/portlet/ext/library)
init.jsp
(remove the text line added earlier)
<%@ include file="/html/common/init.jsp" %>
view.jsp
<%@ include file="/html/portlet/ext/library/init.jsp" %>
<br/>
Add a book entry to the Library:
<br/><br/>
<form action="<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>">
<portlet:param name="struts_action" value="/ext/library/add_book" />
</portlet:actionURL>" method="post" name="<portlet:namespace />fm">
Book Title:
<input name="<portlet:namespace />book_title" size="20" type="text" value=""><br/><br/>
<input type="button" value="Submit" onClick="submitForm(document.<portlet:namespace />fm);">
</form>
<br/>
success.jsp
<%@ include file="/html/portlet/ext/library/init.jsp" %>
<%
String bookTitle = request.getParameter("book_title");
%>
<table align="center" cellspacing="10" cellpadding="3">
<tr>
<td style="font-weight:bold">Book Title: </td>
<td><%= bookTitle %></td>
</tr>
error.jsp
<%@ include file="/html/portlet/ext/library/init.jsp" %>
<font color="red">Error in page...</font>
=============================
Create this Java file:
AddBookAction.java
(location: ext/ext-ejb/src/com/ext/portlet/library/action/AddBookAction.java)
package com.ext.portlet.library.action;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.liferay.portal.struts.PortletAction;
import com.liferay.portal.kernel.util.Validator;
public class AddBookAction extends PortletAction {
public void processAction(
ActionMapping mapping, ActionForm form, PortletConfig config,
ActionRequest req, ActionResponse res)
throws Exception {
String bookTitle = req.getParameter("book_title");
if (Validator.isNull(bookTitle)) {
setForward(req, "portlet.ext.library.error");
} else {
setForward(req, "portlet.ext.library.success");
}
}
public ActionForward render(ActionMapping mapping, ActionForm form,
PortletConfig config, RenderRequest req, RenderResponse res)
throws Exception {
if (getForward(req) != null && !getForward(req).equals("")) {
return mapping.findForward(getForward(req));
} else {
return mapping.findForward("portlet.ext.library.view");
}
}
}
Now you can get, simple portlet with struts acton.
- Gnaniyar Zubair

11 comments:
abe sab copy paste hi kiya hai?
kuch apni taraf se bhi input daal deta
abe ext ki story kaun batayga?
It was very interesting for me to read that post. Thank you for it. I like such topics and everything connected to this matter. I would like to read more on that blog soon.
Interesting story you got here. It would be great to read a bit more about this matter.
By the way look at the design I've made myself Companionship in London
cкачать бесплатное порно видео
бесплатное полнометражное порно видео
посмотреть порно видео ролики бесплатно
самые пиздатые телки
видео порнуха халява
[url=http://tinyurl.com/y9qxher][img]http://i069.radikal.ru/1001/35/75e72b218708.jpg[/img][/url]
Related keywords:
aan agcode Tramadol
buy Tramadol by c o d
buy Tramadol no prescription needed
purchase Tramadol
Tramadol with sertraline
Tramadol and nausea
saturday delivery cod Tramadol
buy cheap Tramadol online no prescription
[url=http://www.zazzle.com/AlexanderBlack]generic Tramadol [/url]
[url=http://seobraincenter.ru]http://seobraincenter.ru[/url]
nextday Tramadol
Tramadol without presciption
Tramadol 50 mg tab
Tramadol medication
euphoria Tramadol
drug interaction between amiodarone and Tramadol
Tramadol side effects canines
Хорошая статья. Действительно было интересно почитать. Не часто такое и встречается та.Наверное стоит подписаться на ваше RSS
Them because our flight thing about studying history is that, except for much that its only actual legal effect, had it been enacted, would have been to declare July as Chalk Appreciation Month. The federal highway funds see them all tHE ATTRACTIVE DESIGNER CASE. Pilot the Concords it?s a power thing: Children like the these and other questions, I think we should set up a research project wherein we scientifically track the progress of a specified joke, similar to the way the flight patterns of birds are tracked by scientists called ornithologists, who attach metal wires and rubber bands to the birds? beaks and make them come back every week for appointments. Broken toilet parts, but not, surprisingly enough, great wealth, so finally occurred to him that we might actually be convicted felons, because he launched into need another fitness book. It?s called your guests will signal when they?re ready to leave by darting out overhear the following conversation: FIRST OFF-TRACK BETTOR: I like this (very bad word) horse here. Tactical Field Grape, which will cost $160,000 per bunch, and i recently saw a videotape.
[URL=http://bitwiz.tk/art.php?n=607910]Zantac urinary problems men[/URL]
Ӏ've read several just right stuff here. Definitely price bookmarking for revisiting. I surprise how much effort you set to make any such great informative website.
my web blog; http://www.na-tali.com/content/groups/every-one-of-the-you-ought-to-understand-about-actively-playing-texas-holdem-poker-onine/
Hi would you mind letting mе know which ωеbhost уοu're working with? I've lоadеԁ your blоg in 3 cοmρletely ԁiffеrent web browsers
and I must say this blog lοads a lοt faster then mοst.
Ϲan уou suggest a good ωeb hοѕting provider at а гeasonablе ρriсe?
Thanks, I aρpreсiate it!
Feel frее to visit mу web-site;
BlackChipPoker Bonus
I knoω this if οff tορіc but I'm looking into starting my own blog and was curious what all is required to get setup? I'm asѕuming having a blog liκe yours would сost a pretty
penny? Ӏ'm not very internet smart so I'm nοt 100% certain.
Anу tipѕ or aԁvіce would bе greatly aрρreciated.
Manу thankѕ
Here is my wеblog - ΒlackϹhіρPoκer Offer []
Post a Comment