• No results found

JSF Custom Grid Tags

N/A
N/A
Protected

Academic year: 2020

Share "JSF Custom Grid Tags"

Copied!
50
0
0

Loading.... (view fulltext now)

Full text

(1)

JSF Custom Grid Tags

Mehmet Nacar

Tallahassee, FL

(2)

Optional JSF

(3)

Standard JSF Validators

n

required attribute checks if the input text is

empty.

<h:inputText id="username“

required="true“

value="#{resource.username}“ />

<h:message id="junk1" for="username“ showDetail="true"

errorStyle="color:red"/>

There are also validator methods to check format of the

value

Also there values to look up the property validity.

How do you write custom validators? How do you use them in the

(4)

Standard Navigation

n

Navigation among JSF pages provided by

faces-config.xml

n

Navigation rules defined like below.

<navigation-rule>

<from-view-id>/upload/gFTP.jsp</from-view-id>

<navigation-case>

<from-outcome>proxy</from-outcome>

<to-view-id>/upload/gftpProxy.jsp</to-view-id> </navigation-case>

<navigation-case>

<from-outcome>success</from-outcome> <to-view-id>/upload/fileList.jsp</to-view-id> </navigation-case>

<navigation-case>

<from-outcome>link</from-outcome> <to-view-id>/upload/junk.jsp</to-view-id> </navigation-case>

(5)

Managed Beans

n

All beans has own specific property values.

n

There are also common properties among the beans.

n

submitAction() method is common for all beans.

Returns “success” value that controls navigation.

n

error and errorStatus properties are also common for all beans.

<h:outputText value="#{taskgraph.error}"

rendered="#{taskgraph.errorStatus}" style="color:red" />

n

Error properties catch exceptions and display

(6)

Beans in faces-config.xml

n

managed-bean>

n

<description>Context Bean is for context

tags</description>

n

<managed-bean-name>context</managed-bean-name>

n

<managed-bean-

class>ogce.gsf.context.ContextBean</managed-bean-class>

n

<managed-bean-scope>session</managed-bean-scope>

(7)
(8)

Basic Idea for Grid Service Clients

n

We write JSF tag libraries wrap calls to the Java CoG

kit.

n

This simplifies association of page events (button

clicks, link clicks) with composite Grid actions.

And increase reuse of code.

n

For documentation of the COG Abstraction API and

some programming examples, see

(9)

Custom Tags

n

task

Creates and submits grid tasks

n

taskgraph

Creates and submits grid taskgraphs as Directed Acyclic Graph (DAG)

That is, describes composite, multistep actions

n

taskAdd

Sub component for taskgraph. Adds dependency

n

proxy

Gets and manage proxies from Myproxy server

n

storeContext

Stores job information to ws-context server.

n

upload

(10)

JSF Grid Beans

n

Package ogce.gsf has the following:

ResourceBean: loads properties from resources.properties

ProxyManagerBean: stores the Grid credential.

TaskBean: simple job submission

TaskGraphBean: creates composite task submissions

FactoryBean: manages multiple TaskBean and TaskGraphBean

instances for a single user

GridFTPManagerBean: file operations and file browsing

ContextBean: client to the WS-Context server, provides context

browsing.

(11)

Managed Beans (Again)

n

All beans has own specific property values.

n

There are also common properties among the beans.

n

submitAction() method is common for all beans.

Returns “success” value that controls navigation.

n

error and errorStatus properties are also common for all beans.

<h:outputText value="#{taskgraph.error}"

rendered="#{taskgraph.errorStatus}" style="color:red" />

n

Error properties catch exceptions and display

(12)

Resource Bean

n

Resource bean works with resource bundles.

resource.properties should be on the classpath.

For webapps its path is WEB-INF/classes

For jars its path is the parent directory.

The following are example properties with associated get/set methods.

hostname = gf1.ucs.indiana.edu

provider = GT2

taskname = test

executable = PWSCF/pwscf

#arguments = 120

stdin = /tmp/pwscf_input

stdout = /tmp/out

source =

gridftp://gf1.ucs.indiana.edu/home/manacar/altix

target = gridftp://gf1.ucs.indiana.edu/home/manacar/out

contextURI = /tmp/vlab/manacar

(13)

Proxy Manager Bean

n

Gets proxy from myproxy server.

n

Stores the proxy into session, since proxy is sharable

among portlets.

n

Its parameters taken by resource bean.

n

Action method of proxy bean is authenticate.

<h:commandButton

(14)

Task Bean

n

Major task unit of Java COG abstractions.

n

Corresponds to GRAM job submissions.

n

Gets input parameters, prepares task and submit it.

n

Works with Factory Bean.

Factory Bean manages multiple instances for a single user.

Each Factory Bean associated with Cookie/Session, so Tomcat and JSF

manage Factory Beans for different users

n So we only have to worry about multiple beans owned by same user. n Tomcat distinguishes different users for us.

n

All submitted tasks stored in the factory.

n

TaskBean implements StatusListener to report status changes

n

<o:task id="task1" method="#{task.create}" type="FileTransferInput" />

n

<o:task id="task2" method="#{task.create}" type="JobSubmit" />

(15)

Task Submission Form

<h:panelGrid columns="3" >

<h:outputText value="Hostname (*) "/> <h:inputText value="#{task.hostname}"/> </h:panelGrid>

<h:panelGrid columns="3" >

<h:outputText value="Provider (*) "/> <h:inputText value="#{task.provider}"/> </h:panelGrid>

Corresponding JSF snippets

<o:taskGraph id="myGraph" method="#{taskgraph.test}" >

<o:task id="task1" method="task.create" type="FileTransfer" /> <o:task id="task2" method="task.create" type="JobSubmit" /> <o:task id="task3" method="task.create" type="FileTransfer" /> <o:taskAdd name="task1" method="taskgraph.add" />

<o:taskAdd name="task2" depends="task1" method="taskgraph.add" /> <o:taskAdd name="task3" depends="task2" method="taskgraph.add" /> </o:taskGraph>

<h:panelGrid columns="2">

<h:commandButton id="submit" value="Submit" action="#{taskgraph.submitAction}"/> <h:commandButton value="Clear" type="Reset"/>

(16)

Task Monitoring with JSF

Data Model

<h:dataTable value="#{jobData.jobs}" var="job"> <h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Job ID" /> </f:facet>

<h:outputTextvalue="#{job.jobId}"/> </h:column>

<h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Submit Date" />

</f:facet>

<h:outputTextvalue="#{job.submitDate}"/> </h:column>

<h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Finish Date" />

</f:facet>

<h:outputTextvalue="#{job.finishDate}"/> </h:column>

<h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Status" /> </f:facet>

<h:outputTextvalue="#{job.status}"/> </h:column>

</h:dataTable>

Corresponding Java class.

public class Job {

private String jobId;

private String status;

private String submitDate;

private String finishDate;

(17)

Factory Bean

n

Controls bean creations and listeners.

Clones beans and stores bean instances in the session.

n

Factory Bean contain three hashmaps to store task features.

Beans (TaskBean)

Graphs (TaskGraph)

Listeners (for both)

n

Java COG listeners propagates status changes to listeners and beans.

status, finishDate properties changes accordingly.

n

Monitoring actions are called by Factory Bean

n

Factory Bean initiates stores data to JobData object that shown by JSF page

n

JobData has List to in data table.

n

Action methods

monitorAction() is for task bean

(18)

TaskGraph Bean

n

TaskGraph Bean manages a workflow of tasks.

n

It creates composite tasks using DAG.

n

User has to define tasks and their dependency.

Otherwise tasks runs independently.

n

TaskGraph can compose sub taskgraphs.

n

TaskGraph Bean has two internal Java COG object.

Taskgraph object: defines taskgraph spec and paramaters.

Handler object: works with StatusListener to get status changes.

(19)

GridFTPManagerBean

n

Provides file browsing, download, upload and file removing.

n

Establish a gridftp connection

<h:commandButton id="submit" value="Submit" action="#{gftp.getConnection}"/> n

Browse files with doList()

doList() loads filelist. It is an internal method called by getConnection()

n

Delete files with delete()

<h:commandButton value="Delete" action="#{gftp.delete}" actionListener="#{gftp.filename}"> <f:param id="finame" name="fname" value="#{file}"/>

</h:commandButton>

n

Download files with download()

<h:commandLink value="" action="#{gftp.download}" actionListener="#{gftp.filename}"> <h:graphicImage value="#{file.piclink}"/>

(20)

ContextBean

n

ContextBean provides navigation on ws-context

server.

n

Session keys of context server are like below.

vlab://tmp/manacar/task1/timestamp

This is just a URI structured name convention

n

vlab://tmp/ is the root for all

n

Each user’s personal context follows.

n

Similar to linux directory structure. (Base directory

like below.)

vlab://tmp/manacar/blah/blah2/blah3

(21)

Grid Faces Tags

n

All of the beans shown previously can be used in conventional standalone JSF way.

n

They are also associated with custom JSF tag extensions we developed:

• <o:task/>, <o:taskGraph/>, <o:taskAdd/> and <o:contextStore/>

n

Purpose is to define composite actions that are associated with submit button clicks,

etc.

• That is, commandButton and commandLink

n

Taskgraph is parent tag and the others are child tags.

<f:verbatim>

<o:taskGraph id="myGraph" method="#{taskgraph.test}" binding="#{taskgraph.taskgr}" > <o:task id="task1" method="#{task.create}" type="FileTransferInput" />

<o:task id="task2" method="#{task.create}" type="JobSubmit" />

<o:task id="task3" method="#{task.create}" type="FileTransferOutput" />

<o:taskAdd id="taskadd1" name="task1" depends="task2" method="taskgraph.add" /> <o:taskAdd id="taskadd1" name="task2" depends="task3" method="taskgraph.add" />

<o:contextStore id="context" type="store" method="none" /> </o:taskGraph>

(22)

Importing GSF Taglibs

n

Taglibs are defined in tld files.

<component>

<description>Taskgraph component</description>

<component-type>taskGraph</component-type>

<component-class>ogce.gsf.tags.UITaskGraph</component-class>

</component>

• Corresponding components defined in

faces-config.xml

<tag>

<name>taskGraph</name>

<tag-class>ogce.gsf.tags.TaskGraphTag</tag-class> <body-content>JSP</body-content>

<attribute>

<name>id</name> </attribute>

<attribute>

<name>method</name> </attribute>

<attribute>

<name>binding</name> </attribute>

(23)
(24)

WS-Context

n

A context is a nugget of information with an associated name.

• You can read/write contexts.

• You can store arbitrary byte arrays--but for VLAB we typically store strings

n

WS-Context server provides database access wrapped with web services.

n

We’ve developed smart clients to store contexts like unix file system.

• Normally contexts are flat, associated only with UUID, not structured • We added the structure to use file system tree-like structure.

n

Basically there two concepts in WS-Context.

• Session keys (URI) are (hopefully) human comprehensible names.

n vlab://tmp/manacar/12506-041932/tr/

• Context keys (uuid) define the unique system name of the context.

n uuid:0A556090-7464-11DA-ABF3-E30096A3A69A-1135418397994

n

Session keys to store branches (directories)

n

Context keys to store contexts (files)

(25)

WS-Context II

n

Storing information to context store is done by several beans.

• TaskGraph Bean creates a unique context URI for each job submission • TaskListener stores changing values on runtime like status, finishDate

• Hpsearch stores output file location on remote site (needed for vizualization).

n

VLab monitoring pages involves context reading and browsing.

n

Browsing page takes user home directory on context service and allow users to

navigate on their workspace.

<user-attribute>

<description>User Name</description> <name>user.name</name>

</user-attribute>

n

Only storing to context is tagged by taglibs.

• <o:contextStore id="context" type="store" method="none" />

n

Context browsing is done by associated JSF pages and data tables

(26)

Reading Context in JSF

<h:outputText value="Context Name "/>

<h:outputText value="#{context.contextName}" />

<h:outputText value="Context Value "/>

<h:outputText value="#{context.contextValue}" />

<h:outputText value="Context Status "/>

<h:outputText value="#{context.contextStatus}" />

(27)

Browsing on context

n

Context browsing provided by navigate(String parent) method.

n

Portlet gets user.name property and builds up user’s context

vlab://tmp is root context for vlab portal

User manacar will have context

n vlab://tmp/manacar

n

When reach to leaf node, It can access to contexts in it.

n

For example, vlab://tmp/manacar/task1/timestamp

There are certain context in this location listed below.

Resource bean properties (with taskname)

Status context

SubmitDate context

FinishDate context

Input file location

Output file location

FSU location (transferring output file for viz. process)

(28)

Using the Context Navigation

<h:dataTable value="#{contextlist.contexts}" var="ctx"> <h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Icon" /> </f:facet>

<h:commandLink value="" action="#{context.navigate}" actionListener="#{context.contextName}">

<h:graphicImage value="#{ctx.piclink}"/>

<f:param id="cname" name="cname" value="#{ctx}"/> </h:commandLink>

</h:column> <h:column>

<f:facet name="header">

<h:outputText style="font-weight: bold" value="Context Name" /> </f:facet>

<h:outputText value="#{ctx.name}"/> </h:column>

(29)

Reading from context

n

Methods from ContextBean

n

navigate()

Main method of context navigation

Prepares contextList to being display by navigation JSF

page.

n

getSessionDirectoryInfo(String parent)

n

getContextFromLeafSession(Vector session_info)

n

wipeOut(String user_session_key)

(30)

Storing to context

n

Context store tag wraps Context Bean storeContext method

as taglib.

n

ContextBean wraps context API with JSF pages.

n

ContextPublishClient is base API for ws-context smart

client.

n

3 methods to save a context

SessionInfo[] find_session(String user_identifier,

String qualifier)

URI find_session_key(String identifier, String qualifier)

ContextDetail saveContext(String user_identifier,

(31)

properties.properties

######################################################################## #

# FTHPIS - Property file used to set parameters for UDDI-Extended # Information Service

# Web Site: http://grids.ucs.indiana.edu/~maktas/fthpis/index.html #

######################################################################### ######################################################################### #

# Userid/passwords should not generally be stored in clear text #

#########################################################################

cgl.fthpis.jdbcUser = uddi_user cgl.fthpis.jdbcPassword = changeIt

######################################################################### #

# The WSDL address for the inquiry and publishing API of the target # UDDI-Extended Information Service

#

######################################################################### #UDDI_Extended_WSDL = http://localhost:8080/uddi_wscontext/services/UDDI_Extended #UDDI_WSContext_WSDL = http://localhost:8080/uddi_wscontext/services/UDDI_WSContext

UDDI_Extended_WSDL = http://gf8.ucs.indiana.edu:4647/uddi_wscontext/services/UDDI_Extended UDDI_WSContext_WSDL = http://gf8.ucs.indiana.edu:4647/uddi_wscontext/services/UDDI_WSContext

################################################################################ # NB Parameters. Please replace following NB parameters to point to your

# Narada Broker

################################################################################ hostname = gf8.ucs.indiana.edu

portnum = 4648

These are properties

in the client’s

uuid_wscontext_beta.

jar.

(32)

Ws-Context

jars

n

NaradaBrokering.jar

n

activation.jar

n

axis-ant.jar

n

axis.jar

n

commons-discovery.jar

n

commons-logging.jar

n

jaxrpc.jar

n

jsp-api.jar

n

jug-uuid.jar

n

junit.jar

n

mail.jar

n

saaj.jar

n

servlet-api.jar

n

uddi_wscontext_beta.jar

n

wscontext.0_wtimestamp.jar

n

wsdl4j.jar

Hpsearch

Context monitoring

Jar conflicts can

(33)

JSF Portlets for

GridSphere: Some

Supplemental Slides

(34)

GridSphere 2.x

n

Deployment on Gridsphere requires some additional configuration.

n

Make sure CATALINA_HOME set.

n

GridSphere normally runs in Tomcat 5.0.2x. If you want to run in Tomcat

5.5.x, you should

a) install Tomcat 5.5's java 1.4.2 compatibility package as instructed above,

and

b) copy ant.jar and ant-launcher.jar from Tomcat 5.0.2x's common/lib directory

into 5.5.x's common/lib.

n

Also edit the tomcat-users.xml file in the jakarta-tomcat-5.5.x/conf

directory to add the following role and user:

<?xml version='1.0' encoding='utf-8'?>

<tomcat-users>

<role rolename="manager"/>

(35)

JSF Sample Portlet

n

Sample portlet is the Sun provided guessNumber portlet example available

from the JSF source code distribution. It is packaged to work inside the

GridSphere container.

n

Instructions:

Set gridsphere environment variable

n gridsphere.home=/home/manacar/gridsphere-2.0.2

n gridsphere.build=/home/manacar/gridsphere-2.0.2/build

‘ant install’ makes it work on Gridsphere

n To work with Tomcat 5.5.x, all commons jar files from Tomcat 5.0.2x should be added to

common/lib. Otherwise JSFportlets doesn’t work.

n Move the following jar files from $CATALINA_HOME/server/lib to

$CATALINA_HOME/common/lib: (It is for only Tomcat 5.0.2x)

• commons-beanutils.jar • commons-digester.jar

n After deploying, start up GridSphere and create a group from Admin->Groups with the

(36)

Gridsphere portlets

n

GridSphere portlet apps use the following

files:

web.xml (required) - specifies GS portlet loader

servlet

gridsphere-portlet.xml (required) - specifies GS

portlet loader portlet

portlet.xml (required) - a portlet descriptor

(optional) group.xml - a group descriptor

(optional) layout.xml - a layout associated with the

(37)

MyproxyManager Portlet

n

The following steps for developing a JSF portlet:

n

Place source code into /src directory

~/jsfMyproxyManager/src/proxymanager

n

Place JSP files into /webapp directory

~/jsfMyproxyManager/webapp

n

Place config files into /webapp/WEB-INF

~/jsfMyproxyManager/webapp/WEB-INF

n

Place required jars into /lib/ext

~/jsfMyproxyManager/lib

n jsf-api.jar

n jsf-portlet.jar

n proxymanager-api-3-3.0.jar n jsf-impl.jar

n jstl.jar

(38)

web.xml

web.xml <web-app>

<display-name>JSF Proxy portlets</display-name> <description>

Provides JSF Proxy portlets </description>

<context-param>

<param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value>

</context-param> <context-param>

<param-name>javax.faces.application.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value>

</context-param> <context-param>

<param-name>com.sun.faces.portlet.INIT_VIEW</param-name> <param-value>/ProxyManager.jsp</param-value>

</context-param> <context-param>

<param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value>

(39)

web.xml II

<!-- Faces Servlet --> <servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup> 1 </load-on-startup>

</servlet> <servlet>

<servlet-name>PortletServlet</servlet-name>

<servlet-class>org.gridlab.gridsphere.provider.portlet.jsr.PortletServle t</servlet-class>

</servlet>

<!-- Faces Servlet Mapping --> <servlet-mapping>

<servlet-name>Faces Servlet</servlet-name> <url-pattern>/myproxy/*</url-pattern>

</servlet-mapping> <servlet-mapping>

<servlet-name>PortletServlet</servlet-name>

<url-pattern>/jsr/jsfMyproxyManager</url-pattern> </servlet-mapping>

(40)

faces-config.xml

<faces-config> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>de</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>es</supported-locale> </locale-config> </application> <navigation-rule> <description>

The decision rule used by the NavigationHandler to determine which view must be displayed after the current view, greeting.jsp is processed.

</description>

<from-view-id>/ProxyManager.jsp</from-view-id> <navigation-case>

<description>

Indicates to the NavigationHandler that the response.jsp view must be displayed if the Action referenced by a UICommand component on the greeting.jsp view returns the outcome "success".

</description>

<from-outcome>success</from-outcome> <to-view-id>/GetProxy.jsp</to-view-id> </navigation-case>

(41)

<navigation-rule> <description>

The decision rules used by the NavigationHandler to determine which view must be displayed after the current view, response.jsp is processed.

</description>

<from-view-id>/GetProxy.jsp</from-view-id> <navigation-case>

<description>

Indicates to the NavigationHandler that the greeting.jsp view must be displayed if the Action referenced by a UICommand component on the response.jsp view returns the outcome "success".

</description> <from-outcome>success</from-outcome> <to-view-id>/ViewAndDispose.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <description>

The decision rules used by the NavigationHandler to determine which view must be displayed after the current view, response.jsp is processed.

</description>

<from-view-id>/ViewAndDispose.jsp</from-view-id> <navigation-case>

<description>

Indicates to the NavigationHandler that the greeting.jsp view must be displayed if the Action referenced by a UICommand component on the response.jsp view returns the outcome "success".

</description> <from-outcome>success</from-outcome> <to-view-id>/ProxyManager.jsp</to-view-id> </navigation-case> </navigation-rule> <managed-bean> <description>

(42)

portlet.xml

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

ion="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocati on="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/x

ml/ns/portlet/portlet-app_1_0.xsd"> <portlet>

<description>JSF MyProxy Portlet</description> <portlet-name>myproxyManager</portlet-name> <display-name>JSF MyProxy Portlet</display-name>

<portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class> <supports>

<mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports>

<portlet-info>

<title>MyProxy Portlet</title> <short-title>myproxy</short-title> </portlet-info>

(43)

group.xml

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

<portlet-group>

<group-name>jsfMyproxyManager</group-name>

<group-description>JSF MyProxy portlets</group-description>

<group-visibility>PUBLIC</group-visibility>

<portlet-role-info>

<portlet-class>jsfMyproxyManager#myproxyManager</portlet-class>

<required-role>USER</required-role>

(44)

layout.xml

<portlet-tabbed-pane>

<portlet-tab label="JSF MyProxy Manager"> <title lang="en">JSF MyProxy Manager</title> <portlet-tabbed-pane style="sub-menu">

<portlet-tab label="myproxyManager"> <title lang="en">MyProxy Portlet</title> <table-layout>

<row-layout>

<column-layout>

<portlet-frame label="proxyPF">

<portlet-class>jsfMyproxyManager#myproxyManager </portlet-class> </portlet-frame>

</column-layout> </row-layout>

</table-layout> </portlet-tab>

</portlet-tabbed-pane> </portlet-tab>

(45)

gridsphere-portlet.xml

<portlet-app-collection> <portlet-app-def>

<portlet-app id="org.gridlab.gridsphere.provider.portlet.jsr.PortletServlet"> <portlet-name>JSR Portlet Servlet</portlet-name>

<servlet-name>PortletServlet</servlet-name> </portlet-app>

<concrete-portlet-app id="org.gridlab.gridsphere.provider.portlet.jsr.PortletSer vlet.1">

<concrete-portlet>

<portlet-name>Portlet Servlet</portlet-name> <default-locale>en</default-locale>

<language locale="en"> <title>Portlet Servlet</title>

<title-short>Portlet Servlet</title-short>

<description>A JSR Portlet Loader</description> <keywords>portlet servlet</keywords>

(46)

Managed Beans

n

The most important features of a bean is are

the properties that it exposes. A

property

is

any attribute of the bean that has

a name

a type (type should be a Java Object)

methods for getting and/or setting the property

(47)

MyProxyBean

public class MyProxyBean {

private int SECS_PER_MIN = 60; private int SECS_PER_HOUR = 3600; private GSSCredential proxyCred=null; String userName = null;

String hostName = null; String passPhrase = null; String proxyView = null; Integer lifetime = null; Integer portNumber = null; public MyProxyBean() { }

….

…. ….

(48)

GetProxy.jsp

<HTML>

<HEAD> <title>Proxy Fetching Example</title> </HEAD> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<body bgcolor="white"> <f:view>

<h:form id="entryForm" >

<h3>Fill out the form to get your proxy credential</h3> <h:panelGrid columns="3">

<h:outputLabel for="userSt"> <h:outputText value="User Name:"/> </h:outputLabel>

<h:inputText id="userSt" required="true"

value="#{MyProxyBean.userName}"> </h:inputText>

<h:message id="junk1" for="userSt" showDetail="true"

errorStyle="color:red"/>

<h:outputLabel for="submit">

(49)

Standard JSF navigation rules

n Make sure MyProxyBean.authenticate returns a value “success” to match with navigation

<navigation-rule> <description>

The decision rule used by the NavigationHandler to determine which view must be displayed after the current view, greeting.jsp is processed.

</description>

<from-view-id>/ProxyManager.jsp</from-view-id> <navigation-case>

<description>

Indicates to the NavigationHandler that the response.jsp view must be displayed if the Action referenced by a UICommand component on the greeting.jsp view returns the outcome "success".

</description>

<from-outcome>success</from-outcome> <to-view-id>/GetProxy.jsp</to-view-id> </navigation-case>

(50)

Getting Session

n

PortletSession gets session in the bean

n

It’s allowed to store session to ProxyStore.

n

FacesContext facesContext =

FacesContext.getCurrentInstance();

n

PortletSession portletSession = (PortletSession)

facesContext.getExternalContext().getSession(false);

n

try {

n

ProxyManager.addProxy(portletSession, proxyCred);

n

GSSCredential proxy = (GSSCredential)

ProxyManager.getDefaultProxy(portletSession);

References

Related documents

An analysis of the economic contribution of the software industry examined the effect of software activity on the Lebanese economy by measuring it in terms of output and value

Implementations JSON (mockup) json- schema OData CSDL CSDL Validator CSDL to json-schema Converter Profile Simulator Service Validator Interface Emulator (PATCH, POST)

Unfortunately, the only early thirty-hour movement seen by the author, fitted with a round brass dial of the 1770s or 1780s signed Samuel Harlow, has had the lifting piece

JSP file and executes the servlet) (HTTP get or post) (HTML File) Response Request Servlet File Response Request Java Component JSP Engine... User request a JSP Execute Servlet

Back when DeLucia spent a few days in Fischer’s apartment in Budapest, organizing the transport, he read the book Finding Bobby Fischer, which had been the private property of

allow the passenger information network to be connected to other networks such as the aircraft.

A cash and items that should turn into cash in the near future B cash invested by the owner of the business.. C items bought for long term use by