File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes struts2+json mapping issue... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2+json mapping issue..." Watch "struts2+json mapping issue..." New topic

struts2+json mapping issue...

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336

I am passing values via json to select box...

Currently I am in cules.jsp...

I have a button 'Click' which takes me to tabtest.jsp which contains the 2 select boxes...

First select has countries list...

On selection of a country,I make an ajax call which goes to culesModelAction class to get all cities in that country which should be populated in 2nd select box...

In culesModelAction, I managed to prepare values

in tabtest.jsp after the Ajax call,

I added this for json in struts.xml...

<package name="default1" extends="json-default" >
<action name="Cules" class="CulesModelAction" >
<result type="json">
<param name="root">jsonData</param>

I also have the normal one...

<include file="struts-default.xml"/>
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">


<action name="cules" class="CulesModelAction">
<result name="success">/jsp/tabtest.jsp</result>
<result name="failure" >/jsp/cules.jsp</result>

Now the problem is before I go to tabtest.jsp to select a country,when i click the button 'Click'(as said above) I get a window and I have no clue about this....

opening rules.action

You have choosen to open rules.action

firefox is allowing you to open or save this file [Browse]

OK Cancel buttons

instead of being directed to tabtest.jsp as it was before adding that json mapping in struts.xml

I get this one...
Current policy properties
thread.thread_num_limited: true
file.write.state: disabled
mmc.sess_cab_act.block_unsigned: false
mmc.sess_cab_act.action: validate
mmc.sess_pe_act.block_blacklisted: false
mmc.sess_pe_act.block_invalid: true
jscan.sess_applet_act.stub_out_blocked_applet: true
jscan.sess_applet_act.block_all: false
window.num_limited: true disabled
file.nondestructive.state: disabled
net.connect_other: false
thread.thread_num_max: 8
jscan.sess_applet_act.sig_invalid: block
mmc.sess_cab_act.block_invalid: true
jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5
mmc.sess_pe_act.action: validate
thread.threadgroup_create: false
net.bind_enable: false
jscan.sess_applet_act.sig_trusted: pass
jscan.sess_applet_act.sig_blacklisted: block
jscan.session.daemon_protocol: http
net.connect_src: true
jscan.sess_applet_act.unsigned: instrument
mmc.sess_pe_act.block_unsigned: false
file.destructive.state: disabled
mmc.sess_cab_act.block_blacklisted: true
window.num_max: 5

what could be it? If I remove that json mapping,I dont get this .Anything wrong with the mapping?I can't make it a single mapping,can
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Is this making any sense at all?Experts kindly look into it. David, this is the new post of the previous issue...
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
Is this totally unclear???
It is sorta covered in the JavaRanch Style Guide.
subject: struts2+json mapping issue...
It's not a secret anymore!