aspose file tools*
The moose likes Struts and the fly likes Struts tiles framework not action in URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts tiles framework not action in URL" Watch "Struts tiles framework not action in URL" New topic
Author

Struts tiles framework not action in URL

Alex Sh
Greenhorn

Joined: Dec 10, 2012
Posts: 7
Hello, I need help in Struts tiles framework. How to make loading jsp in the URL is not recorded action, ie page is loaded and is in action, and when it restarts the browser sends a request to the server, it is necessary that it was not. Page layout should be done only in the tiles-defs.xml.
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
Hi,

Can you please explain little bit more? not able to understand question....


Thanks,
Shailesh
Alex Sh
Greenhorn

Joined: Dec 10, 2012
Posts: 7
Hi, Shailesh!

I have progect, in it i use Struts + Spring frameworks: Struts MVC, tiles; Spring IoC. When i go to page, the URL is: (e.g.) localhost/Project/NewsAction?actionMethod=edit. And when i reload page, it send request on server, but i want to redirect on page and cause the action when submit form. Page consists of tiles. I can make <tiles:insert definition="newsedit"> in jsp, and it will be work, but i must declare tiles only in tiles-def.xml.

my tiles-def.xml:



struts-config.xml:

Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
I have progect, in it i use Struts + Spring frameworks: Struts MVC, tiles; Spring IoC. When i go to page, the URL is: (e.g.) localhost/Project/NewsAction?actionMethod=edit. And when i reload page, it send request on server, but i want to redirect on page and cause the action when submit form. Page consists of tiles. I can make <tiles:insert definition="newsedit"> in jsp, and it will be work, but i must declare tiles only in tiles-def.xml.


there are two things which I clicked while I was read your post.

when you refresh page again action is got called. and again same page is getting displayed, instead of that you want to redirect to newsEdit page.
Means on refresh you want to submit a form.

OR

On form submission you want to show one more jsp on same page and your issue is how can you avoid displaying that on first time and display it on form submission?

Please tell which is the correct from above ?
Alex Sh
Greenhorn

Joined: Dec 10, 2012
Posts: 7
First is correct. I don't want to handle action when i refresh page, i want to refresh anly page, may be page must saved in cache and load from cache.
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 365
Hi,

It is not possible to stop calling action while you hit a refresh button, because it is default behavior of a browser to call a url on refresh.
Alex Sh
Greenhorn

Joined: Dec 10, 2012
Posts: 7
Yes, i know it, but how don't use action in URL. I want to give the same result when i do: <forward name="edit" path="newsedit.jsp" redirect="true">; change it on <forward name="edit" path="newsedit" redirect="true"> - and will give the same effect. I need use only tiles-defs.xml for definition tiles, don't definition tiles in jsp.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts tiles framework not action in URL
 
Similar Threads
Session tracking and tiles
How do i automatically load a jsp tiles page when by default?
bean:define error - Cannot find bean in scope null
struts2 action from tiles definition fired multiple times
Struts-Tiles Reloading Problem