How to migrate to a specific part of a html page after a struts action forward? - struts-1

I am using Struts 1. I wonder how I can show a particular part of a html page after mapping.findForward("success"); is returned and a jsp is processed.
For example, I can use this url to show a part of html with id="contact" even if it is way below on a page.
http: //www.mycompany.com/generalInfo#contact
But how can I do it after a struts action forward?

Related

JSF: How to update the URL without redirect the page?

I have a JSF page, and I would like to update the content using ajax (re-rendering just some parts), but I also want to update the URL. Is there a way?

Passing parameter as hidden in wicket

Please new in wicket wants to know how to pass value from wicket java page to an input field in its html page. (like if the java page is kachi.java and the html page is kachi.html).
I would suggest you to read about wicket models and PageParameters on
https://ci.apache.org/projects/wicket/guide/6.x/

Prevent page reloading in Struts 2

I am currently working on a small web app and this is the first time i am using Struts2. Here is what i am trying to achieve.
A Struts2 JSP page on form post, calls a struts action. Once this action completes it task, I need to return to the calling JSP with out any page reloading (avoid postback).
how can i achieve.can any one please help me?.
It is called AJAX (no kidding).
In Struts2 you can use Struts2-jQuery Plugin to achieve that pretty easily.
As AndreaLigios said, you can achieve this using struts-j query plug-in.
Create a remote page to display your result.
use
<sj:sbmit targets="[div_id]" />
on your main page to submit the form
Add a div to your main page to display the remote page.
<div id="[div_id]" />
In your struts.xml, just return the remote page as a result of your action.

URL fragment in links and ajax redirects in JSF

I found out that methods called by ajax actions in JSF 2.0 can return navigation case and then the page can be redirected.
Eg. when I am on page index.xhtml and my ajax call return navigation case detail then the page is redirected. That is great.
<h:commandLink value="The link" action="#{bean.someAction}" >
<f:ajax />
</h:commandLink>
But now I would like to do only partial redirect in the current page, so I would like to use URL fragment. The desired final URL looks like this index.xhtml#someComponentId. I have tried to do it with appending of #fragment part behind the navigation case but it doesn't work.
Is there any way how to make ajax and normal redirects able to use URL fragments, please? Thanks for your responses.
You can specify fragments all day in your code but you have nothing to parse those fragments. Your going to need more control over your page. I have used the jQuery hashchange plugin briefly. http://benalman.com/projects/jquery-hashchange-plugin/. There is also a plugin called BBQ, which is on the same page and does more.
Your then going to need to specify a callback(there are tutorials on that site I gave you) to direct the page what to do on that particular hash.
Check out the examples.
http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/
I know this answer is kind of vague but I believe it will point you in the correct direction on how to solve this issue.

Spring MVC and WML web page?

is it possible to contruct and use a WML page instead of a normal html page to render my views that contain a form?
i could not find any examples on how to achieve this and i could not even find the "form" tag in WML. Instead, from my understanding WML, uses cards with input tags to process a form of some sort but in Spring mvc's SimpleFormController it is used in conjunction to a html form not a WML input card.
Spring MVC's controller infrastructure doesn't care if the page is rendered in HTML or WML. Both HTML forms and WML cards end up generating HTTP requests when submitted, and the controller can't tell the difference.
However, Spring only provides an HTML form tag library, so if you want to generate WML, you'll have to do it all yourself.
Is this really something you want to get into, though? WML is obsolete, and only very old phones need it.

Resources