Bookmark Topic Watch Topic
  • New Topic

Is it possible to append default get variables to url

 
Eman Adenola
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello, I'm wondering is it possible to append default get variables to the url.
For example if i click on the jsp or html file it should automatically have an address like home.jsp&query=l
unfortunately when i add it it does home&query=l.jsp ..which doesn't work.
Any ideas?
Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
I really have no idea what you are trying to accomplish. Could you explain it more clearly?
 
Eman Adenola
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi, thanks for reply.
I have a file called home.jsp.
But I would like to called it home.jsp?var=true
so that when i click on the file and it loads on the browser that it would be that address instead of home.jsp.
If i was to save the file as home.jsp?var=true it wouldn't run because it isn't an html file?
Or is there another soln? Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Why aren't you just putting the query string on the href of the link?
 
Eman Adenola
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hey, It is the home page..so the user cannot click a link unless the user is in another page. That works then..
Because in the home.jsp i am including a file that has dynamic content..what it displays changes..i used a choose on initial load to see if the query string is empty..if it is empty..then i display a default message..

But I don't want to use the choose..I guess there isn't a way then...

By the way.. does <c:redirect> invalidate a <c:set> session variable? I had to use session.setAttribute to get what i wanted.
Thanks for help.
 
Vijitha Kumara
Bartender
Posts: 3952
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Report post to moderator
Eman Adenola wrote:By the way.. does <c:redirect> invalidate a <c:set> session variable? I

How did you use the <c:set> tag?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Eman Adenola wrote:By the way.. does <c:redirect> invalidate a <c:set> session variable? I had to use session.setAttribute to get what i wanted.
Thanks for help.

It depends. A redirect (of any type) results in a new request, so any scoped variables placed into request scope will no longer be available.
 
Eman Adenola
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,
thanks for replying.

Well, I used it this way


But what Bear said makes sense then..because it didn't work ha.

I have a new problem..I'm not sure whether i should make a thread for it..but I will just ask if you don't mind. Thanks.

I have a resultset from a database displayed on a page. I know how to limit it to display 100 rows.
I think i can create a next link that can display the next 100 rows...
But I have no idea how to create a 1,2,4..... link that google does..
Any ideas?
Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
It's best to ask new questions in new topics. As this one is all jumbled up, I'm going to close it so you can ask your new question in a new topic.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!