Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 8th, 2008, 04:59 AM
ish ish is offline
Registered User
 
Join Date: Oct 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Struts 2.2, Json data and jsp problem, help pls

Hi

I am using struts 2.20, jsp and strutsjson plugIn. I have download plugIn into WEB-INF/lib directory. I think plugIn seem to be working.

I have following action <p>
public class CreateJsonAction implements Action
{
          JSONObject obj2=new JSONObject();
      obj2.put("StartDate","2007-04-12 11:00:00");
      obj2.put("GoogleRef","60.472024, 8.468946");
      obj2.put("Element","Sleeve/Backup");
      obj2.put("Film","Golden Child");

      List<JSONObject> myJsonList = new
                                ArrayList<JSONObject>();
      myJsonList.add(obj);
    return SUCCESS;
}


struts.xml
 <action name="FilmJsonAction3"
         class="web.struts.test.MyJsonAction">
      <result name="success"
              type="json">/WEB-INF/jsp/json.jsp</result>
 </action>

When I call this action from the browser, the action get activated and json data is pumped to the browser. But it displaying json data as string in a new window and doesn't open requested jsp ie json.jsp.

Please can you help me, how can I applied this json data (list if json data) to my jsp. So when I open this jsp page, data get populated. I would appreciated an example.

many thank

ish
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts+JSP nishi_gupta Struts 2 October 16th, 2007 02:58 AM
JSON problem with accentuation jlamas Ajax 0 September 8th, 2006 07:25 AM
JSP web Development ch-18 struts problem wilson_kwan JSP Basics 0 December 12th, 2004 01:17 PM
Chapter - Struts - Traditional or Model1- Pls help ipatchu JSP Basics 0 November 18th, 2003 03:06 AM
i am new in java and JSP...pls help! frankiepoon JSP Basics 0 August 18th, 2003 08:51 PM



All times are GMT -4. The time now is 09:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.