On 12/5/05, Deepa Khetan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Just a bit of a question. Can i do some thing in Struts, which will enable
> me to show the same URL all the time, for my aplication?? i mean i do not
> want to show in the URL which action mapping i am calling, as in,
> https://<IpAddress>     thats it, for all my actions??

Sure. In a "normal" non-Ajax world you still need to have one action
that processes requests. Basically, a front controller. Then you do
in-server forward to an actual action that serves the request, and it
forwards to a JSP page to display a view. In this case either all
requests should be POSTs to hide parameters, or you need to do a
redirect to a view to hide them (see second option).

You can go with a more elaborate path to avoid problems with Back
button and implicit resubmits on page refresh. In this case you accept
an initial request, no matter GET or POST. Then you redirect to a
particular action processing the request. It changes the application
state and saves it in the session. Then you redirect to the same front
action. It pulls application state from the session and forwards to a
view, corresponding to the state. How front action knows that this
time it should render a view instead of forwarding to processing
action? Simple. The redirect request (1) has GET type and (2) is
empty, that is, no parameters.

The third option known to me is using Ajax and updating page fragments
without reloading the whole page.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to