You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by rekha murugesan <ma...@yahoo.com> on 2002/10/31 19:50:31 UTC

Using more than one template with a servlet

I am new to Velocity and have searched the archives
for answers with out success

I am using servlets. I want to load a frameset and
three other templates in the frameset (all three need
data from the context of the servlet).

Now I am passing frameset template to VelocityServlet
with hidden fields for the other values in the three
other templates. And am use DHTML to set the values
when they get loaded. I have problem with netscape
browsers in this approach. Is there any way by which I
can overcome this problem by directly parsing the
three files?

Regards,
Rekha 

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by Rekha <ma...@yahoo.com>.
--- Peter Harrison <pe...@nothingbutnet.co.nz> wrote:
> On Fri, 01 Nov 2002 08:32, Rekha wrote:
> 
> > > How do you imagine that happens?  The browser makes another
> > > request to the servlet, and asks for the URL specified in the
> > > src attribute.  Your sevlet will see 4 requests.  1 for the
> > > frameset and 1 for each frame.
> > >
> > > 	-bob
> >
> > The browser will see the just the src attribute for the file to load in the
> > frames. It does not directly ask the servlet for the file.
> 
> For each file specified in each frame the browser will make a separate request 
> to the server. Putting the data in the context of the original request won't 
> pass it on to the further requests.
> 
> If you want the framesets to display the data you will need to write an 
> additional servlet to load them and reload the information you wish to 
> display into the context. Alternatly you might have the first servlet add the 
> information into the session.
> 
> Regards,
> 
> Peter

Thanks, that has clarified my doubt.

Regards,
Rekha


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by Peter Harrison <pe...@nothingbutnet.co.nz>.
On Fri, 01 Nov 2002 08:32, Rekha wrote:

> > How do you imagine that happens?  The browser makes another
> > request to the servlet, and asks for the URL specified in the
> > src attribute.  Your sevlet will see 4 requests.  1 for the
> > frameset and 1 for each frame.
> >
> > 	-bob
>
> The browser will see the just the src attribute for the file to load in the
> frames. It does not directly ask the servlet for the file.

For each file specified in each frame the browser will make a separate request 
to the server. Putting the data in the context of the original request won't 
pass it on to the further requests.

If you want the framesets to display the data you will need to write an 
additional servlet to load them and reload the information you wish to 
display into the context. Alternatly you might have the first servlet add the 
information into the session.

Regards,

Peter

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by Daniel Dekany <dd...@freemail.hu>.
Thursday, October 31, 2002, 8:32:41 PM, Rekha wrote:


> --- bob mcwhirter <bo...@werken.com> wrote:
>> > > If it's a frameset, doesn't the browser make a
>> > > request back for each frame?
>> > 
>> > No, the path of the file to be loaded in the frames
>> > are given in the src attribute of the frames tag, that
>> > will load automatically
>> 
>> How do you imagine that happens?  The browser makes another
>> request to the servlet, and asks for the URL specified in the
>> src attribute.  Your sevlet will see 4 requests.  1 for the
>> frameset and 1 for each frame.
>> 
>>       -bob
>
> The browser will see the just the src attribute for the file to load in the frames. It does not
> directly ask the servlet for the file.
[snip]

The HTTP server does not understand HTML, so it will not automatically
send the frames together with the frameset or something like that...
>From the viewpoint of the HTTP server, sending a HTML that will be
visible in a frame is the same as sending any other HTML. The HTTP
server does not know if it sends a "frame" or a "frameset", nor that
there is any connection between those files (i.e. between the frameset
and the frames).

Also, it does not mater how do you refer to a file (say, with src
attribute), if that file becomes visible on the client side, then the
client has sent a HTTP request to get that file.

If you have to connect these request somehow on the Servlet side, you
can use sessions, or place the required information into the src
attribute of <frame>-s (with "query-string") when you generate the
frameset.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by Rekha <ma...@yahoo.com>.
--- bob mcwhirter <bo...@werken.com> wrote:
> > > If it's a frameset, doesn't the browser make a
> > > request back for each frame?
> > 
> > No, the path of the file to be loaded in the frames
> > are given in the src attribute of the frames tag, that
> > will load automatically
> 
> How do you imagine that happens?  The browser makes another
> request to the servlet, and asks for the URL specified in the
> src attribute.  Your sevlet will see 4 requests.  1 for the
> frameset and 1 for each frame.
> 
> 	-bob

The browser will see the just the src attribute for the file to load in the frames. It does not
directly ask the servlet for the file.

Rekha

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by bob mcwhirter <bo...@werken.com>.
> > If it's a frameset, doesn't the browser make a
> > request back for each frame?
> 
> No, the path of the file to be loaded in the frames
> are given in the src attribute of the frames tag, that
> will load automatically

How do you imagine that happens?  The browser makes another
request to the servlet, and asks for the URL specified in the
src attribute.  Your sevlet will see 4 requests.  1 for the
frameset and 1 for each frame.

	-bob


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by rekha murugesan <ma...@yahoo.com>.
--- "Geir Magnusson Jr." <ge...@adeptra.com> wrote:
> On 10/31/02 1:50 PM, "rekha murugesan"
> <ma...@yahoo.com> wrote:
> 
> > I am new to Velocity and have searched the
> archives
> > for answers with out success
> > 
> > I am using servlets. I want to load a frameset and
> > three other templates in the frameset (all three
> need
> > data from the context of the servlet).
> > 
> > Now I am passing frameset template to
> VelocityServlet
> > with hidden fields for the other values in the
> three
> > other templates. And am use DHTML to set the
> values
> > when they get loaded. I have problem with netscape
> > browsers in this approach. Is there any way by
> which I
> > can overcome this problem by directly parsing the
> > three files?
> 
> If it's a frameset, doesn't the browser make a
> request back for each frame?
> 
> -- 
> Geir Magnusson Jr. 
> geirm@adeptra.com                                   
> +1-203-355-2219 (w)
> Adeptra Inc.                                        
> +1-203-247-1713 (m)
> 
------------------

No, the path of the file to be loaded in the frames
are given in the src attribute of the frames tag, that
will load automatically

Rekha

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using more than one template with a servlet

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 10/31/02 1:50 PM, "rekha murugesan" <ma...@yahoo.com> wrote:

> I am new to Velocity and have searched the archives
> for answers with out success
> 
> I am using servlets. I want to load a frameset and
> three other templates in the frameset (all three need
> data from the context of the servlet).
> 
> Now I am passing frameset template to VelocityServlet
> with hidden fields for the other values in the three
> other templates. And am use DHTML to set the values
> when they get loaded. I have problem with netscape
> browsers in this approach. Is there any way by which I
> can overcome this problem by directly parsing the
> three files?

If it's a frameset, doesn't the browser make a request back for each frame?

-- 
Geir Magnusson Jr. 
geirm@adeptra.com                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>