This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes conditionally targetting the client frame based on Server(servlet) program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "conditionally targetting the client frame based on Server(servlet) program" Watch "conditionally targetting the client frame based on Server(servlet) program" New topic
Author

conditionally targetting the client frame based on Server(servlet) program

Polireddy Vanukuri
Greenhorn

Joined: Jul 24, 2006
Posts: 6
Hi..
I have 2 frames in my page. The first frame is Login frame. Second frame is Error frame.
Login frame having login form with 2 textboxes.. username and password & a submit button. I m submitting form information to a servlet. In the servlet i have to decision of where(to which frame) to send response.If username and password are matches to some particular values,then a response as "Login Success" has to be send to login frame(first frame itself).

If the username or password are not matched to the specific values, then a response with error message "Login failure.. User name u entered is Incorrect" has to be send to Error frame(second frame).

I m giviing a target for the form tag.Its a static target. But here my problem is.. server program has to take decision in which frame response has to be sent.

So pls help me regarding this.
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
Why not use some hidden fields to distinguish where the request came from along with sendRedirect.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
Polireddy Vanukuri
Greenhorn

Joined: Jul 24, 2006
Posts: 6
Thanks for ur response.
But there is no argument for sendRedirect() or forward() to specify the target(frame name) of the page.For these methods. we will specify URL of the page which has to be sent as response.But how can the servlet can specify the target frame in those methods?

Help me in this context clearly.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I'm tempted to say : don't use frames
That's an old concept and might be not used around anymore.
(sorry it doesn't help)


[My Blog]
All roads lead to JavaRanch
Polireddy Vanukuri
Greenhorn

Joined: Jul 24, 2006
Posts: 6
If so, Pls tell me the correct way for my application..
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can't.
See: http://www.coderanch.com/t/363030/Servlets/java/targeting-client-frame


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: conditionally targetting the client frame based on Server(servlet) program
 
Similar Threads
jsp, servlet-mapping, forward request problem
Redirect & https
Browser Path Not Refreshing
Changing the Target of a submitted form
Passing value from one servlet to another