Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: calling a JSP from Javascript


Message #1 by nazneen shaikh <shaikhnazneens@y...> on Tue, 18 Feb 2003 21:03:59 -0800 (PST)
	Could you resume the problem (and maybe open a new thread) and post
it ?  I'm lost in the discussion :)  Posting ome code might be also a 
good
idea to let us have a global view.

> -----Message d'origine-----
> De : Fahad Khan [mailto:fahad_djs@h...]
> Envoy=C3=A9 : mercredi 26 f=C3=A9vrier 2003 16:28
> =C3=80 : javascript
> Objet : [javascript] Re: calling a JSP from Javascript
>
>
>
> Hi Teng-Fong,
> Thank you, But in the code
> (somePage.jsp?constantParameter=3DconstantValue&databaseParamete
> r=3D" + varHavingDatabaseValue) , I just tried to differntiate
> between the values that we have in a variable=C2=A0and those we
> hard-code them as they are constant (not kept in a variable
> as not neccessary at some places).
> constantParameter=3DconstantValue, demonstrates values that are
> hard-coded while
> "&databaseParameter=3D"+varHavingDatabaseValue, is the variable
> having value that may vary irrespective to its source (could
> be an array, database etc.).
> Well Yes "encoding" advice is appreciated. :)
> Fahad,
> ....................
>
>
>
>
> >From: "SEAK, Teng-Fong"
> >Reply-To: "javascript"
> >To: "javascript"
> >Subject: [javascript] Re: calling a JSP from Javascript
> >Date: Wed, 26 Feb 2003 16:11:45 +0100
> >
> >The crucial instruction is the following :
> >
> >top.frame2.location.href =3D
> 
>"somePage.jsp?constantParameter=3DconstantValue&databaseParameter=3D" 
+
> >varHavingDatabaseValue
> >
> >Is constantValue a variable name ? Is yes, it should be like this :
> >
> >top.frame2.location.href =3D
> >"somePage.jsp?constantParameter=3D" + constantValue +
> "&databaseParameter=3D" +
> >varHavingDatabaseValue
> >
> >As a word of warning, it's better use encodeURIComponent (or
> escape if you
> >like, but this function is deprecated) to encode your query
> string to avoid
> >invalid characters appearing in it.
> >
> > > -----Message d'origine-----
> > > De : nazneen shaikh [mailto:shaikhnazneens@y...]
> > > Envoy=C3=83=C2=A9 : mardi 25 f=C3=83=C2=A9vrier 2003 11:02
> > > =C3=83=E2=82=AC : javascript
> > > Objet : [javascript] Re: calling a JSP from Javascript
> > >
> > >
> > > Hi Fahad,
> > > And Thanks a lot.
> > > I was trying the same syntax but there was a problem
> > > in the quotes that I had given to form the string for
> > > href.
> > > Regards
> > > Nazneen
> > > --- Fahad Khan wrote:
> > > >
> > > > Hello,
> > > > As you said you have an application, I=C3=82=C2=A0assume, you
> > > > are working within a browser. This is also not quite
> > > > clear that how a page can be thrown? I assume, you
> > > > are browsing a page in another frame.
> > > > The situation as I see is that you have two frames.
> > > > One has a 'tree' and another has nothing by default.
> > > > When you click any node, a page is browsed in
> > > > another frame. you do it by doing this:
> > > > top.frame2.location.href=3D"somePage.jsp"
> > > > If you are doing=C3=82=C2=A0same thing on=C3=82=C2=A0node's 
clicking
> > > > event, you could pass the parameters in a
> > > > querystring from the same place as :
> > > >
> > > 
top.frame2.location.href=3D"somePage.jsp?constantParameter=3Dconst
> > > antValue&databaseParameter=3D"+varHavingDatabaseValue
> > > > In above example, parameters are passed from
> > > > frame=C3=82=C2=A0having nodes, to the frame which has to browse 

> > > > the given page. Now in "somePage.jsp" get the
> > > > parameters from the querystring. that needs bit of
> > > > jsp skills.
> > > > Another method to pass parameters is a post method.
> > > > But first let me know that are u looking for the
> > > > same thing.
> > > > =C3=82=C2=A0
> > > > Fahad Khan
>

  Return to Index