Author: david.borruat
Date: 2010-06-17 09:39:15 -0400 (Thu, 17 Jun 2010)
New Revision: 3365
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
Log:
jsphellouser
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-06-17
12:13:45 UTC (rev 3364)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2010-06-17
13:39:15 UTC (rev 3365)
@@ -38,11 +38,36 @@
public void doView(RenderRequest request, RenderResponse response) throws
PortletException, IOException
{
- String sYourName = (String) request.getParameter("yourname");
- if (sYourName != null)
+ String sPage = (String) request.getParameter("page");
+ if (sPage != null)
{
- PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
- prd.include(request, response);
+ if(sPage.equals("about")){
+
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/about.jsp");
+ prd.include(request, response);
+ }
+ else if(sPage.equals("fedora")){
+
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/fedora.html");
+ prd.include(request, response);
+ }
+ else
+ {
+ PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/rh-logo.html");
+ prd.include(request, response);
+ }
+
+//
+// if(sPage.equals("about")){
+//
+// PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher("/jsp/about.html");
+// prd.include(request, response);
+// }
+
+
+
+
+
}
else
{
@@ -70,8 +95,8 @@
public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws
PortletException, IOException,
UnavailableException
{
- String sYourname = (String) aRequest.getParameter("yourname");
- aResponse.setRenderParameter("yourname", sYourname);
+ String sPage = (String) aRequest.getParameter("page");
+ aResponse.setRenderParameter("page", sPage);
}
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp 2010-06-17
12:13:45 UTC (rev 3364)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp 2010-06-17
13:39:15 UTC (rev 3365)
@@ -2,7 +2,7 @@
<portlet:defineObjects/>
-<div class="portlet-section-header">Remember we love you: <%=
renderRequest.getParameter("yourname") %></div>
+<div class="portlet-section-header">Remember we love you: <%=
renderRequest.getParameter("page") %></div>
<portlet:renderURL var="myRenderURL"/>
<br/>
Modified:
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
===================================================================
---
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2010-06-17
12:13:45 UTC (rev 3364)
+++
sandbox/mobile_delivery/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2010-06-17
13:39:15 UTC (rev 3365)
@@ -1,124 +1,31 @@
<%@ taglib
uri="http://java.sun.com/portlet_2_0" prefix="portlet"
%>
-<style type="text/css">
- body {
- background-color: #ddd;
- color: #222;
- font-family: Helvetica;
- font-size: 14px;
- margin: 0;
- padding: 0;
-
- text-align: justify;
- }
- #header {
- background-color: #ccc;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ccc),
to(#999));
- border-color: #666;
- border-style: solid;
- border-width: 0 0 1px 0;
- }
- #header h1 {
- color: #222;
- font-size: 20px;
- font-weight: bold;
- margin: 0 auto;
- padding: 10px 0;
- text-align: center;
- text-shadow: 0px 1px 0px #fff;
-
- /* below for header ellipsis */
- max-width: 160px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-
- }
- ul {
- list-style: none;
- margin: 10px;
- padding: 0;
- }
- ul li a {
- background-color: #FFF;
- border: 1px solid #999;
- color: #222;
- display: block;
- font-size: 17px;
- font-weight: bold;
- margin-bottom: -1px;
- padding: 12px 10px;
- text-decoration: none;
- }
- ul li:first-child a {
- -webkit-border-top-left-radius: 8px;
- -webkit-border-top-right-radius: 8px;
- }
- ul li:last-child a {
- -webkit-border-bottom-left-radius: 8px;
- -webkit-border-bottom-right-radius: 8px;
- }
- ul li a:active,ul li a:hover {
- /* background-color:blue;*/
- background-image: -webkit-gradient(linear, left top, left bottom, from(#5d87b1),
to(#2c6aa9));
- color:white;
- }
- #content {
- padding: 10px;
- text-shadow: 0px 1px 0px #fff;
- }
- #content a {
- color: blue;
- }
-
- #progress {
- -webkit-border-radius: 10px;
- background-color: rgba(0,0,0,.7);
- color: white;
- font-size: 18px;
- font-weight: bold;
- height: 80px;
- left: 60px;
- line-height: 80px;
- margin: 0 auto;
- position: absolute;
- text-align: center;
- top: 120px;
- width: 200px;
- }
-
- #header div.leftButton {
- font-weight: bold;
- text-align: center;
- line-height: 28px;
- color: white;
- text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
- position: absolute;
- top: 7px;
- left: 6px;
- max-width: 50px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- border-width: 0 8px 0 14px;
- -webkit-border-image: url(../images/back_button.png) 0 8 0 14;
- -webkit-tap-highlight-color: rgba(0,0,0,0);
- }
-
- #header div.leftButton.clicked {
- -webkit-border-image: url(../images/back_button_clicked.png) 0 8 0 14;
- }
+<div class="portlet-section-header">Welcome !</div>
-</style>
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
+
+<br/>
+
+<div class="portlet-font">Method 1: We simply pass the parameter to the
render phase:<br/>
+<a href="<portlet:renderURL><portlet:param name="page"
value="about"/></portlet:renderURL>">about</a>
+<a href="<portlet:renderURL><portlet:param name="page"
value="fedora"/></portlet:renderURL>">fedora</a>
+<a href="<portlet:renderURL><portlet:param name="page"
value="rhome"/></portlet:renderURL>">rhome</a>
+</div>
+<br/>
+
<div id="container">
<div id="header">
- <!--h2><a href="./">None</a></h2-->
+ <h2><a href="./">None</a></h2>
<div id="menu">
<ul>
- <li><a href="about.html">About Red
Hat</a></li>
- <li><a href="rh-logo.html">Red Hat
Logo</a></li>
- <li><a href="fedora.html">Fedora</a></li>
+ <li><a href="<portlet:renderURL><portlet:param
name="page"
value="about"/></portlet:renderURL>">about</a></li>
+ <li><a href="<portlet:renderURL><portlet:param
name="page"
value="fedora"/></portlet:renderURL>">fedora</a></li>
+ <li><a href="<portlet:renderURL><portlet:param
name="page"
value="rh-logo"/></portlet:renderURL>">rh-logo</a></li>
</ul>
</div>
+</div>
</div>
\ No newline at end of file