You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Vijay Aalati <vi...@altair.com> on 2007/03/09 20:07:58 UTC
Accessing parameters in MyFacesGenericPortlet
Hi,
I am new to JSF and Portlets. I wrote a JSF code in which I have a
text-field (<h:inputText>) and I want to access the value entered in it
in my portlet class which I wrote extending the MyFacesGenericPortlet.
So how do I access it's value? Usually in Servlets we can do this by
using the request.getParameter(). Below is my code in which I have the
text-field (<h:inputText>). Now how do I access it's value in my portlet
class?
-----------------------------------------------------------------
<%@ page language="java" session="true" %>
<%@ page import = "javax.portlet.PortletSession" %>
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portlet" %>
<f:loadBundle basename="altair.adm.login.messages" var="msg"/>
<portlet:defineObjects/>
<portlet:actionURL var="loginAction">
<portlet:param name="command" value="doLogin" />
</portlet:actionURL>
<html>
<head>
<title>ADM Login</title>
</head>
<body>
<f:view>
<div align="center">
<h:form>
<h:panelGrid columns="2">
<h:outputText value="#{msg.user_id_tag}" />
<h:inputText value="" required="true" id="ADM_USER_ID" />
<h:commandButton action="#{loginAction}"
value="#{msg.login_button_tag}" id="ADM_LOGIN_BUTTON"/>
</h:panelGrid>
<br/>
</h:form>
</div>
</f:view>
</body>
</html>
-----------------------------------------------------------------
Thanks,
Vijay Aalati
Re: Accessing parameters in MyFacesGenericPortlet
Posted by Aaron Evans <aa...@gmail.com>.
Yes, request.getParameter is what you use in processAction or in
doView, doEdit, etc.
On 3/9/07, Vijay Aalati <vi...@altair.com> wrote:
> Hi,
>
> I am new to JSF and Portlets. I wrote a JSF code in which I have a
> text-field (<h:inputText>) and I want to access the value entered in it
> in my portlet class which I wrote extending the MyFacesGenericPortlet.
> So how do I access it's value? Usually in Servlets we can do this by
> using the request.getParameter(). Below is my code in which I have the
> text-field (<h:inputText>). Now how do I access it's value in my portlet
> class?
>
>
>
>
>
> -----------------------------------------------------------------
>
> <%@ page language="java" session="true" %>
>
> <%@ page import = "javax.portlet.PortletSession" %>
>
>
>
> <%@ page language="java" pageEncoding="ISO-8859-1"%>
>
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>
> <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portlet" %>
>
> <f:loadBundle basename="altair.adm.login.messages" var="msg"/>
>
> <portlet:defineObjects/>
>
> <portlet:actionURL var="loginAction">
>
> <portlet:param name="command" value="doLogin" />
>
> </portlet:actionURL>
>
> <html>
>
> <head>
>
> <title>ADM Login</title>
>
> </head>
>
> <body>
>
> <f:view>
>
> <div align="center">
>
> <h:form>
>
>
> <h:panelGrid columns="2">
>
>
> <h:outputText value="#{msg.user_id_tag}" />
>
>
> <h:inputText value="" required="true" id="ADM_USER_ID" />
>
>
>
> <h:commandButton action="#{loginAction}"
> value="#{msg.login_button_tag}" id="ADM_LOGIN_BUTTON"/>
>
> </h:panelGrid>
>
> <br/>
>
> </h:form>
>
> </div>
>
> </f:view>
>
> </body>
>
> </html>
>
>
>
> -----------------------------------------------------------------
>
>
>
>
>
> Thanks,
>
> Vijay Aalati
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org