File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP tag logic calling struts action which returns json Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP tag logic calling struts action which returns json" Watch "JSP tag logic calling struts action which returns json" New topic
Author

JSP tag logic calling struts action which returns json

Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
Hello
i have a tag library written. the tag library doStartTag method needs to invoke a struts action located at the following URL
http://www.xxx.com/someaction.do?format=json.

This action will return a json string by reading the request cookies, gets the user name from the cookie and queries the database to see whether the user is valid or not. if the user is valid it returns the response code

i was wondering how can i post a request to the struts action and gets the response back through the tag.

any idea

Thanks
darniz
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

PageContext.include()


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
Thanks
can you please provide some sample code
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61008
    
  65

No, please read NotACodeMill. Try it yourself and see what happens.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSP tag logic calling struts action which returns json