Hi Foong,

you need to use method="post" for the form.

Dennis

Foong Kim Seong wrote:
Hi, below is my portlet. I have tried in so many ways.. but the page (or
the Porlet.java didn't invoke the processAction()).

The flow of the system is; entry.jsp is prompt (working fine) and user
will enter the data and hit the submit button (this part didn't work).
My assumption is once user hit the submit button, it'll called the
processAction() in the RegistrationPortlet.java.
This is my source file:

RegistrationPortlet.java

==================

..

..

public class RegistrationPortlet extends GenericPortlet {

      public void processAction(ActionRequest request, ActionResponse
response)

                  throws PortletException, IOException {

System.out.println("request.getContentType():"+request.getContentType())
;

            System.out.println("request.getPortalContext():
"+request.getPortalContext());

            System.out.println("Action " +
request.getParameter("action"));

            System.out.println("Hello world process Action : "

                        + request.getParameter("username"));

      }

      public void init(){

            System.out.println("************ Registering Portlet");

            try {

                  super.init();

            } catch (PortletException e) {

                  // TODO Auto-generated catch block

                  e.printStackTrace();

            }

            System.out.println("************ Registered");

      }

      public void doView(RenderRequest request, RenderResponse response)

                  throws PortletException, IOException {

            response.setContentType("text/html");

            System.out.println("Hello world doView");

            PortletRequestDispatcher dispatcher = getPortletContext()

                        .getRequestDispatcher("/WEB-INF/jsp/entry.jsp");

            dispatcher.include(request, response);

      }

..

..

This is my entry.jsp

<%@ taglib uri="http://java.sun.com/portlet"; prefix="portlet" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

    pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>

<html>

<head>

<portlet:defineObjects/>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Registration Screen</title>

</head>

<body>

   <form action="<portlet:actionURL
windowState="maximized"><portlet:param name="page" value="mainview"
/></portlet:actionURL>" >

      Name:  <input type="text" name="username"/><br>

      IC:   <input type="text" name="ic" /><br>

      Address : <input type="test" name="address1"/>

      <input type="submit" value="submit" />

   </form>

      </body>

</html>

This is my portlet.xml

<?xml version="1.0" encoding="UTF-8"?>

<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";

             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.x
sd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";

             version="1.0">

   <portlet>

      <portlet-name>RegistrationPortlet</portlet-name>

<portlet-class>com.mimos.portlet.RegistrationPortlet</portlet-class>

      <supports>

         <mime-type>text/html</mime-type>

         <portlet-mode>VIEW</portlet-mode>

         <portlet-mode>EDIT</portlet-mode>

         <portlet-mode>HELP</portlet-mode>

</supports>
      <portlet-info>

         <title>Foong Registration Portlet</title>

      </portlet-info>

   </portlet>

</portlet-app>

Can you see anything wrong???

Thank You.

Regards,

FOONG


------------------------------------------------------------------
-
-
-
DISCLAIMER: This e-mail (including any attachments) may contain confidential information. If you are not the intended recipient, you are hereby notified that any dealing, review, distribution, printing, copying or use of this e-mail is strictly prohibited. If you have received this email in error, please notify the sender or MIMOS Berhad immediately and delete the original message. Opinions, conclusions and other information in this e-mail that do not relate to the official business of MIMOS Berhad and/or its subsidiaries shall be understood as neither given nor endorsed by MIMOS Berhad and/or its subsidiaries and neither MIMOS Berhad nor its subsidiaries accepts responsibility for the same. All liability arising from or in connection with computer viruses and/or corrupted e-mails is excluded to the fullest extent permitted by law.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to