Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening a JSP from javascript

 
Krishna Attravanam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do something like this

<a href=javascript:void(window.open('loadinfo.do?product_id=<dynamicValue>','load','location=0,status=0,scrollbars=0,width=480,height=400'))>Some Text </a>

I am trying to opening a JSP file using the javascript (& Struts) and the productID is dynamic...

I am not able to do it coz i am making a mistake with the syntax

Please help me with this Thanks

~K
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to help coz I don't know your mistake.

Show what you are trying instead of something like what you are trying and I or someone else can probably help.
 
Krishna Attravanam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically I am trying to open a jsp page in a pop up window using Javascript.

Now the page to be loaded is dependent upon the product id i pass..

Say if the product id is 2 a page named page2.jsp is loaded

so a different page is loaded based on the product id

how do i do it
 
Mike Farnham
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krishna,

I would have a generic JSP as an intermediate step (dispatcher).

Your JavaScript can call it with the ProductID.
In the generic JSP, you can create the necessary URL and forward/re-direct to it.

Cheers,
Mike
 
Trevor Whitehead
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Krishna Attravanam:
I am trying to do something like this

<a href=javascript:void(window.open('loadinfo.do?product_id=<dynamicValue>','load','location=0,status=0,scrollbars=0,width=480,height=400'))>Some Text </a>

I am trying to opening a JSP file using the javascript (& Struts) and the productID is dynamic...

I am not able to do it coz i am making a mistake with the syntax

Please help me with this Thanks

~K

Hi Krishna, it may be best to call a javascript function that accepts a couple of parameters to open the new window, calling the function with an onClick event from your form.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic