• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting Bad Request

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,
In my application i have a jsp in which i 'm writing a line


When i click on the link it gives HTTP 400 bad request error:

the struts-config.xml file has the entry :


The action class has the method displayDepartment

What's wrong in this?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this case, I'd suggest using the page attribute of <html:link> rather than the href. While href evaluates the URI the same as an <a> html tag would, page evaluates it relative to the context root. For more information, see the heading "link" in this document.

In your example, the code would be:

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to redirect to jsp without performing any loginc.In that case you can try this, index.jsp in the jsp you need to redirect.


Hope this helps.

Thanks and Regards,
Arul.
 
Akshay Singhvi
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this:


But i'm getting a blank page with this in the address bar :
http://localhost:9080/wcw/displayDepartment.do?methodToCall=displayDepartment

what is wrong in this???
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most likely cause of this problem is that the execute method of the com.mmm.wcw.web.admin.department.DepartmentLoadAction class may be returning a null ActionForward. Put some System.out.println statements in your code to display the ActionForward just before it's returned and see if maybe this is the case.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic