Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

custom link tags

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to be able to re-use jsp pages between different apps. But these jsp pages will have links to a) external links (that need http://) and b) internal links (that dont need http). The internal links I want to be able to click on and stay with in each apps general framework. But I cant do this with a link like <a href="index2.html">Next Page</a> cause it removes the enitre page.
What can I do? Do I have to create some kind of custom tag, and if so where can I find examples.
I know one problem is making this code generic enough where I dont have to modify the files and re-use them from app to app.
Please Help.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(Not sure If I understand your problem entirely)
Many ways to do that I guess ,one way to have different links on the same jsp, you could use a Properties file, which could have app-specific links. Your JSP page could be like
<a href=<%links.getProperty("somelink")%>>
Hope this helps..
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anthony Smith:
.... But I cant do this with a link like <a href="index2.html">Next Page</a> cause it removes the enitre page.


I am also not sure I completely understand - what do you mean "it removes the entire page"? Perhaps with a little more information we can help you out.
Cheers
Simon
 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I guess really I have one jsp that uses the jsp include to show other pages in order to give it a borderless frame look. But when I saw removes the page if I click on the link, that link takes over the whole page instead of just that the part where the include tag was. I just wish I knew a way to just repalce section that had the include.
 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's an example jsp page...
<%@ include file="header.jsp" %>
<%@ include file="mypage.jsp" %>
<%@ include file="footer.jsp" %>
Ok mypage.jsp has a link to mypage2.jsp But when the link to mypage2.jsp is clicked ideally I want it to show up on the page but in the context of:
<%@ include file="header.jsp" %>
<%@ include file="mypage2.jsp" %>
<%@ include file="footer.jsp" %>
So that I can still get my header and footer.
But I want to do this in such a way that it is independent of web applications...
And then my second problem is if I have a button and do a submit whatever the results are I want them to show up as:
<%@ include file="header.jsp" %>
<%@ include file="results.jsp" %>
<%@ include file="footer.jsp" %>
The only problem is I wanted it all dynamic cause you will never know what the name of the page that has:
<%@ include file="header.jsp" %>
<%@ include file="...whateverfile..." %>
<%@ include file="footer.jsp" %>
is going to be. S
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic