File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Don't get the parameter in handler in MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Don Watch "Don New topic

Don't get the parameter in handler in MVC

Ashraf Fouad
Ranch Hand

Joined: Oct 07, 2001
Posts: 80
I have a strange problem in WebSphere Application Server 3.5.5:
I pass a parameter in a page that submits to a handler in a form that uses method="post", and I put an alert before submitting in java script, and I'm sure from the output that I'm sending a parameter named "Page". This works fine in my machine with Visual age 3.5.2 with tomcat test environment & working on WebSphere Application Server 3.3.5 working in Oracle 8.1.7 on Solaris fine.
But when I'm moving on WebSphere application Server in the customer locvation which uses DB2 as reposotry ==> the variable in the parameter comes with null value.
My code is as follows & also I send the output of the System.out.println in the default output of the application server.
String l_szpageParameter = p_Request.getParameter( REQUEST_PAGE );
System.out.println( " l_szpageParameter : " + l_szpageParameter );

String l_szactionParameter = p_Request.getParameter( REQUEST_ACTION );
System.out.println( " l_szactionParameter : " + l_szactionParameter );

String l_szpageAttribute = (String)p_Request.getAttribute( REQUEST_PAGE );
System.out.println( " l_szpageAttribute : " + l_szpageAttribute );

String l_szactionAttribute = (String)p_Request.getAttribute( REQUEST_ACTION );
System.out.println( " l_szactionAttribute : " + l_szactionAttribute );
The output:
l_szpageParameter : null
l_szactionParameter : null
l_szpageAttribute : null
l_szactionAttribute : null
I don't know how to trace to get the reason of this & why specially this page which have nothing than submit form with action.
plz help

Ashraf Fouad
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
how about you change the form method temporarily to GET so that you can see the values are fine?

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
Ashraf Fouad
Ranch Hand

Joined: Oct 07, 2001
Posts: 80
I solved the problem by changing the parameter to hidden input in the page form, I still don't know till now what is the problem but it worked thankx GOD
Ashraf Fouad
Ranch Hand

Joined: Oct 07, 2001
Posts: 80
Unfortuantly, I can't apply this to a form with mult-part request which I'm using for upload, still pressist.
I agree. Here's the link:
subject: Don't get the parameter in handler in MVC
It's not a secret anymore!