• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to get the url append values in strut

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When i click on the link i am getting like this URL

http://localhost:8080/cyberq/jobapply!add.action?cyberQ1

i want to get cyberQ1 values from the above url.

Please help me how to do this.


Thanks





 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi pankaj,

you can get value of cyberQ1 with two ways.

1) make declaration of cyberQ1 in your action and make getter and setter for cyberQ1 variable. Then you can directly use this cyberQ1.

2 ) Second is you can access it using request object. Like request.getParameter("cyberQ1");



 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But cyberQ1 is not my fix url values it can changes when clicks on hyperlink

like



by click the above url the values changes ever time.
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi,

But if your parameter name cyberQ1 change every time then you have to change at make it same.

Because if you want to access some parameter value at least you have to name of this parameter.

other wise how would you access it. ???

so you have at least name of that.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Let me explain my problem.

I am have jsp page which showing list of jobs.

for every jobs there is a link ApplyOnline.


When the user click on the link then this url values changer ever time.


joblist jsp page

















 
Nishan Patel
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I think here your parameter cyberQ1 value change but your parameter name always same cyberQ1

so , you can follow my first Answer.

Value does not affect your code.

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nishan,

In first post you gave two answer which one is good.


Thanks
 
Nishan Patel
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi,


I think both one is good.

But if you don't want to access request object then first one is good.

if you want to access request object you have to implements your action to ServletRequestAware and implement the methid of this interface and then you can aaccess you request object.

So i think first one is good for you.

At last choice is yours.

 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Nishan i got my solutions.
and i used first approach.
 
We begin by testing your absorbancy by exposing you to this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic