Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Opening a JSP from javascript

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic