Here:
public class MyLoginAction extends VelocityPortletAction{
protected void buildNormalContext(VelocityPortlet portlet, Context
context, RunData rundata)
{
if(rundata.getRequest().getAttribute("LOGN_OKAY") != null){
context.put("LOGIN_OKAY","");
}
}
public void doLogin(RunData rundata, Context context)
{
try{
String user = rundata.getParameters().get("user"); //your form-data,
user is the form-field
String user_pw = rundata.getParameters().get("pw"); //your form-data
boolean login_ok = someclass.somemethod(user, pw);
if(login_ok){
rundata.getRequest().setAttribute("LOGIN_OKAY", "");
}
}
catch(Exception e){
e.printStackTrace();
}
}
}
after the response, you have to check within the jsp if LOGIN_OKAY is !=
null and build your page or redirect to a login-failed screen or something
like this...
-----Ursprüngliche Nachricht-----
Von: Hari, Piyush [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 8. August 2005 22:44
An: 'Jetspeed Users List'
Betreff: RE: How to programmitically add or delete a portlet form a PSML p
age ?
Thanks, where do I place the dologin function ? Which class ? Can you write
a sample definition of the methods - dologin and buildnormalcontext ?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, August 08, 2005 4:36 PM
To: 'Jetspeed Users List'
Subject: AW: How to programmitically add or delete a portlet form a PSML p
age ?
I don't know how it works if you define a psml as action-class.
I'd rather do it like this:
<form action="$jslink.setAction("portlets.MyLoginAction")">
...
<input type="submit" name="eventSubmit_doLogin">
now you can handle it within the doLogin- and BuildNormalContext-Methods...
-----Ursprüngliche Nachricht-----
Von: Hari, Piyush [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 8. August 2005 22:31
An: 'Jetspeed Users List'
Betreff: RE: How to programmitically add or delete a portlet form a PSML p
age ?
I wrote my own (see the JSP below), now I have a form action which I want to
redirect to the same psml but with different portlets. How can I accomplish
this ?
-P
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, August 08, 2005 4:25 PM
To: 'Jetspeed Users List'
Subject: AW: How to programmitically add or delete a portlet form a PSML
page ?
jou can modify the juserloginaction or write your own one...
-----Ursprüngliche Nachricht-----
Von: Hari, Piyush [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 8. August 2005 22:21
An: '[email protected]'
Betreff: How to programmitically add or delete a portlet form a PSML page ?
Here is my scenario :
http://localhost:8080/jetspeed/portals/default-page.psml
<http://localhost:8080/jetspeed/portals/default-page.psml> carries a
log-in portlet. Once, the user enters the userID and password and clicks on
the sign-in button, I want the same default-page to reopen without the login
portlet.
How can I do that ? Here is my JSP page I use in the Login portlet:
<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>
<form action = "http://localhost:8080/jetspeed/portal/default-page.psml">
<table>
<tr>
<td><font size="2" face="Verdana">User ID :</font></td>
<td><input type="text" id="text_userID" value=""></td>
</tr>
<tr>
<td><font size="2" face="Verdana">Password :</font></td>
<td><input type="text" id="text_pass" value=""></td>
</tr>
<tr>
<td/>
<td>
<input type="submit" value="Signin">
</td>
</tr>
</table>
</form>
I would really appreciate if someone can help me out with this.
Thanks in advance,
Piyush
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]