Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

Make a Server.Transfer as done in an ASP page

Hi, everybody

I'm new at this forum and wanted to introduce myself before I ask the question.

I'm from Barcelona (Spain), 24 years old and work as a developer.

My question is the following

In ASP technology you can use Server.Transfer statement which tells the server to "execute" another file without the intervention of the client (as done in a Response.Redirect statement)

I would like to know if there's an equivalent sentence in JSP technology

Thanx in advance

Miquel
0
impop
Asked:
impop
  • 4
1 Solution
 
kennethxuCommented:
your need <jsp:forward page="path/anotherpage.jsp" />

Syntax
<jsp:forward page=”relativeURLspec” />
and
<jsp:forward page=”urlSpec”>
{ <jsp:param .... /> }*
</jsp:forward>

Examples
The following element might be used to forward to a page based on some dynamic condition.
<% String whereTo = “/templates/”+someValue; %>
<jsp:forward page=’<%= whereTo %>’ />
0
 
kennethxuCommented:
Syntax
<jsp:forward page="relativeURLspec" />
and
<jsp:forward page="urlSpec">
{ <jsp:param .... /> }*
</jsp:forward>

Examples
The following element might be used to forward to a page based on some dynamic condition.
<% String whereTo = "/templates/"+someValue; %>
<jsp:forward page="<%= whereTo %>" />
0
 
impopAuthor Commented:
Thanx,

but I think jsp:forward tag tells the client with the appropiate HTTP message to redirect to the specified URL, isn't it?
What I want is the same but without client intervention. I think it's called server-side redirection.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
kennethxuCommented:
>> but I think jsp:forward tag tells the client with the appropiate HTTP message to redirect to the specified URL, isn't it?

NO!


>> What I want is the same but without client intervention. I think it's called server-side redirection.

That IS server side redirection as your defination. the formal name is "server-side request forwarding". What make you think it is not?

FYI, client redirection in jsp:
<% response.sendRedirect( "url" ); return; %>
0
 
kennethxuCommented:
why not just try it? it is very easy to tell:

the browser's address will change when client redirection is received, otherwise browser still shows the old url when server forwarding.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to kennethxu

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now