With URL:
view.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:renderURL var="other">
<portlet:param name="jspPage" value="/jsp/sample/success.jsp"/>
</portlet:renderURL>
<a href="<%=other%>">Click Here</a>
success.jsp
<h3>
Successfully navigating from view to success
</h3>
Send value from jsp to other jsp
view.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:defineObjects />
<portlet:renderURL var="other">
<portlet:param name="jspPage"
value="/jsp/sample/success.jsp" />
</portlet:renderURL>
<%
String name="karthik";
session.setAttribute("name",name);
%>
<a href="<%=other%>">Click Here</a>
success.jsp
<%
String
name = session.getAttribute("name").toString();
out.println(name);
%>
(or)
${name}
JSP to JSP with submit form
view.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<portlet:renderURL var="sURL">
<portlet:param name="jspPage"
value="/jsp/sample/success.jsp" />
</portlet:renderURL>
<aui:form action="<%= sURL %>"
method="post">
<aui:input label="First
name" name="fName"
type="text" value=""/>
<aui:input label="Last
name" name="lName"
type="text" value=""/>
<aui:input label="Password"
name="password" type="password"
value=""/>
<b>Gender</b>
<aui:input label="Male"
name="gender" type="radio"
value="Male"/>
<aui:input label="Female"
name="gender" type="radio"
value="Female"/>
<aui:button type="submit"
value="Submit"/>
</aui:form>
success.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />
<%
String fName = renderRequest.getParameter("fName");
String lName = renderRequest.getParameter("lName");
String password = renderRequest.getParameter("password");
String gender = renderRequest.getParameter("gender");
%>
<b>Values Submitted</b><br/>
First name - <%= fName %><br/>
Last name - <%= lName %><br/>
Password - <%= password %><br/>
Gender - <%= gender %><br/>
Was useful Karthik
ReplyDeletehtml language example codes
ReplyDeletehtml example - Parent position absolute child position fixed
Big data app development should understand the need of Data, and they should work to build more appropriate services to meet the requirements of their clients.
ReplyDelete