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 Kristofer Eriksson <Kr...@techmar.de> on 2004/12/16 12:37:24 UTC

RE: Strange JLoginUser problem

Hi,
 
A quick question regarding below problem! It seems I am having the same
problem when trying to use my own custom login action and was wondering if
anyone know what is going on.
 
Using JS 1.5 on tomcat 5
 
Any help appreciated.
 
Kind Regards
 
/Kristofer 
 
 
Date: Wed, 17 Mar 2004 13:22:59 -0800 (PST)
From: Paul Chan <wa...@yahoo.com>
Subject: Strange JLoginUser problem
Content-Type: multipart/mixed; boundary="0-1171076249-1079558579=:135"
 
 
Note: forwarded message attached.
 
 
__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com
Hi All,
 
  I am currently trying to configure my own login and
authentication so I have my own class that overrides
JLoginUser.  However, I have encountered a weird
problem whereby if I use my own class, the user I
typed in would be login but would not forward me to
the correct user psml file.  
 
Here are excerpts from my Jsp file:
 
<form method="POST" action="<jetspeed:dynamicUri/>" >
            <INPUT TYPE="hidden" NAME="js_peid"
VALUE="<%=jspeid%>">
            <input name="action" type="hidden"
value="portlets.MyOwnLoginUser">
          <table border="0" cellspacing="2"
cellpadding="0">
            <tr>
              <td style="font-size:10">UserName</td>
              <td>
                <input value="" name="username"
maxlength="25" type="text" tabindex="1"
style="font-size:10">
              </td>
              <td rowspan="2" align="center">
                <input name="refresh" type="submit"
value="Login" tabindex="4"  style="font-size:10" />
              </td>
              <td> </td>
            </tr>
            <tr>
              <td style="font-size:10">Password</td>
              <td>
                <input value="" name="password"
maxlength="25" type="password" tabindex="2"
style="font-size:10">
              </td>
            </tr>
            <tr>
              <td style="font-size:10" colspan="2">
                <input name="rememberme" value="true"
type="checkbox" tabindex="3" />Remember
              </td>
            </tr>
            <tr>
              <td> </td>
            </tr>
          </table>
        </form>
 
My own portelts.MyOwnLoginUser class just extends
JLoginUser..nothing more. eg:
 
public class MyOwnLoginUser extends JLoginUser
{
 ....
}
 
Now if I use the regular JLoginUser class in my JSP,
everything would work correctly meaning I would be
forward to the correct user psml file.  I don't get
it?  Is there more I need to do in order to duplicate
what JLoginUser does?
 
thanks in advance!
 
P

Re: Strange JLoginUser problem

Posted by Hema Menon <me...@gmail.com>.
Kristofer,

We are using our custom login action on JS1.5 and it is working fine.
We modified the my.properties value for action.login to our class
name. I belive it is not recommended to have hidden action defined in
the jsp pages as per the FAQ on jetspeed on Changing portlet template
as quoted below
http://portals.apache.org/jetspeed-1/faq.html


**********************************************************************************
Changing portlet template
Question	Answer
In my action class extending JspPortletAction, I try to use the
setTemplate method, but it doesn't work. I throws a
NullPointerException in PortletAction when trying to retrieve a
"VelocityPortletContext" (how surprising when working with a
JSPPortlet) Besides, I had to catch this exception myself, otherwise
it wasn't appearing anywhere in the logs, not even a single error
message...

Most common mistake with portlets is to use the hidden action variable
and set it to the portlet's action class:
<form name="form" action="http://myhost/ThingWeb/portal" method="get">
<input type="hidden" name="js_peid" value="<%=jspeid%>"/> <input
type="hidden" name="action" value="ThingieSearchAction"/> <input
type="submit" name="eventSubmit_doSearch" value="Search"> <input
type="reset" value="Clear Fields"> <input type="text" name="thingieid"
size="20"> </form>

In the above example, Turbine executes the action before the portlet
and therefore the context is null. The above should be rewrittern as
follows:
<form name="form" action="<js:portletlink template="" />"
method="get"> <input type="hidden" name="js_peid"
value="<%=jspeid%>"/> <input type="submit" name="eventSubmit_doSearch"
value="Search"> <input type="reset" value="Clear Fields"> <input
type="text" name="thingieid" size="20"> </form>
*****************************************************************************************

Hema

On Thu, 16 Dec 2004 12:37:24 +0100, Kristofer Eriksson
<Kr...@techmar.de> wrote:
> Hi,
> 
> A quick question regarding below problem! It seems I am having the same
> problem when trying to use my own custom login action and was wondering if
> anyone know what is going on.
> 
> Using JS 1.5 on tomcat 5
> 
> Any help appreciated.
> 
> Kind Regards
> 
> /Kristofer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hema Menon

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org