On Tue, 7 Jan 2003 15:42, you wrote:
> I am asking a slightly different question (which has been asked
> before).
>
> I want to direct a user to a page that is passed on to him, via an
> email, say.
>
> http://somewhere.com/somecomp/servlet/somecomp/SOME.vm,id?1

I don't really understand what you are asking, but I think you are
saying that you want to email a link to a secure page to someone who
must log in before viewing the page.

> I would imagine that this link is passed on as a parameter and read
> by a .class file, then passon to Velocity via
> context.put("somelink", "the_above_link"); then, read by the Login.vm
> file using:
>
> <form method="post"
> action="$link.setAction("Login").setPage($the_above_link)">
>
> 1. I don't know which .java file I should use to read the link.

For security you can either write your own session validator class or
do your security checks in your screen class in the isAuthorized()
method (the screen class in your example above would either be
SOME.java or Default.java) and redirect the user to your login
 template.

> 2. in the file that reads this link, what should be put in place of
> the XXXX
>
>  String link = data.getParameters().getString("XXXX");

Assuming you are doing your security checks in your screen class, try
the following code...

  context.put("nextTemplate",
              data.getScreenTemplate().replace('/',','));

... you can then access this from your login template as $nextTemplate.

Note, you will also need to pass any request parameters across to the
screen you are redirecting to.

> 3. setAction("Login").setPage($YYY) in the Form field does not seem
> to work, $YYY is not accepted, a String (i.e. Somefile.vm) is OK.

Try setAction("Login").setPage("$YYY") instead.

Regards,

-- Rodney


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

Reply via email to