Author: chris.laprun(a)jboss.com
Date: 2009-01-20 17:48:48 -0500 (Tue, 20 Jan 2009)
New Revision: 12578
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java
Log:
- Cleaned-up
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java 2009-01-20
21:34:24 UTC (rev 12577)
+++
branches/JBoss_Portal_Branch_2_7/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java 2009-01-20
22:48:48 UTC (rev 12578)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,22 +22,16 @@
******************************************************************************/
package org.jboss.portal.core.samples.basic;
-import java.io.IOException;
-import java.io.PrintWriter;
import javax.portlet.GenericPortlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletContext;
+import java.io.IOException;
+import java.io.PrintWriter;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -47,58 +41,50 @@
{
private static final String JSP_PATH = "/WEB-INF/jsp/ajax";
- public void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, PortletSecurityException, IOException
- {
-
- //String repeatText = req.getParameter("repeat");
- // set the text from form input
- //if (repeatText != null){
- //resp.setRenderParameter("repeat", repeatText);
- //}
- // request view
- //resp.setPortletMode(PortletMode.VIEW);
-
- }
public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws
PortletException, IOException
{
PortletContext context = getPortletContext();
PortletRequestDispatcher rd = context.getRequestDispatcher(JSP_PATH +
"/repeatrefresh.jsp");
rd.include(renderRequest, renderResponse);
}
+
public void serveResource(ResourceRequest req, ResourceResponse resp) throws
PortletException, IOException
{
String repeatText = req.getParameter("repeat");
String prodId = req.getParameter("prodId");
- String namespace =resp.getNamespace();
-
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
- if (repeatText != null){
- writer.print("<div id=\"repeat-text\">"+
req.getPrivateParameterMap().get("repeat")[0] +"</div>");
+ if (repeatText != null)
+ {
+ writer.print("<div id=\"repeat-text\">" +
req.getPrivateParameterMap().get("repeat")[0] + "</div>");
}
- if (prodId != null){
- if (prodId.equals("1")){
- writer.print("<div id=\"product-text\">Product ID:
"+ prodId +"" +
- "<br/>" +
- " B BY BURTON ALPHA<br/>" +
- "Sale Price: $314.96 " +
- "</div>");
+ if (prodId != null)
+ {
+ if (prodId.equals("1"))
+ {
+ writer.print("<div id=\"product-text\">Product ID:
" + prodId + "" +
+ "<br/>" +
+ " B BY BURTON ALPHA<br/>" +
+ "Sale Price: $314.96 " +
+ "</div>");
}
- if (prodId.equals("2")){
- writer.print("<div id=\"product-text\">Product ID:
"+ prodId +"" +
- "<br/>" +
+ if (prodId.equals("2"))
+ {
+ writer.print("<div id=\"product-text\">Product ID:
" + prodId + "" +
+ "<br/>" +
"FORUM DESTROYER LTD<br/>" +
"$319.99 " +
- "</div>");
+ "</div>");
}
- if (prodId.equals("3")){
- writer.print("<div id=\"product-text\">Product ID:
"+ prodId +"" +
- "<br/>" +
- "\n" +
+ if (prodId.equals("3"))
+ {
+ writer.print("<div id=\"product-text\">Product ID:
" + prodId + "" +
+ "<br/>" +
+ "\n" +
"SANTA CRUZ ALLSTAR<br/>" +
"$256.00 " +
- "</div>");
+ "</div>");
}
}
Show replies by date