|
| HATS: Passing a parameter to a HATS application |
 |
Fri, 20 Jul 2007 09:47:58 EDT |
Hello!
I am not sure if this is the right forum, but I didn't find a HATS forum.
I want to pass a parameter from a HTML page to a HATS application. The URL looks
like this:
http://<hostname>:<port>//HATS_Test?name=test
I added business logic to my HATS project, that means I added a java class where
I can set global variables and pass them to the host screen.
The problem is that I am not able to retrieve the parameter from the HTML page,
i.e. "test" in my example.
The IBM docs say that my java class has an object of the type BusinessLogicInfo
and this object can use the javax.servlet.HttpServletRequest class.
My class has the following method:
public static void execute(IBusinessLogicInformation blInfo)
{
String p;
IRequest request;
ISession session;
request = blInfo.getRequest();
session = request.getSession();
p = session.getAttribute("name").toString();
}
After that I get a NullPointerException.
Has anyone got an idea? Is it generally possible to pass a parameter to HATS? If
not I can save my time.
Thanks in advance!
|
| Post Reply
|
| Re: HATS: Passing a parameter to a HATS application |
 |
Fri, 20 Jul 2007 11:23:19 -040 |
michael.bayerl@guetermann.com wrote:
> Hello!
>
> I am not sure if this is the right forum, but I didn't find a HATS forum.
>
> I want to pass a parameter from a HTML page to a HATS application. The URL
looks like this:
> http://<hostname>:<port>//HATS_Test?name=test
>
> I added business logic to my HATS project, that means I added a java class
where I can set global variables and pass them to the host screen.
> The problem is that I am not able to retrieve the parameter from the HTML
page, i.e. "test" in my example.
> The IBM docs say that my java class has an object of the type
BusinessLogicInfo and this object can use the javax.servlet.HttpServletRequest
class.
>
> My class has the following method:
>
> public static void execute(IBusinessLogicInformation blInfo)
> {
> String p;
> IRequest request;
> ISession session;
> request = blInfo.getRequest();
> session = request.getSession();
> p = session.getAttribute("name").toString();
> }
>
> After that I get a NullPointerException.
>
> Has anyone got an idea? Is it generally possible to pass a parameter to
HATS? If not I can save my time.
>
> Thanks in advance!
>
>
The HATS newsgroup is
ibm.software.websphere.hats on news.software.ibm.com
This newsgroup (studio400) is largely WebFacing, JavaTools, WebTools,
RSE, WDSC, etc. for the i5.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|