Solved

a href link in JSP

Posted on 2007-11-29
7
23,812 Views
Last Modified: 2010-05-18
I'm just learning JSP and I have a simple problem, how can I create a link.
This is part of a left menu that is suppose to link to a different page.
<A HREF="<%= PMPage.jsp %>" style="text-decoration:none" class="A">PARK</a>
0
Comment
Question by:aentice
  • 3
  • 3
7 Comments
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 20376979
Do you mean that you want the link to go to PMPage.jsp ?  Then it should be a normal url:

<A HREF="PMPage.jsp" style="text-decoration:none" class="A">PARK</a>

0
 

Author Comment

by:aentice
ID: 20377137
I had it initially that way, but doesn't work. If I try Park/PMPage.jsp
Here's how my folder looks like:
TESTWEB
   WebContent
     images
     Park
        PMpage.jsp
     Web-INF
        LeftMenu.jsp
        main.jsp
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 20377279
Then it looks as if your URL is wrong.

where does your Web app start?  If it's the WebContent directory, then your url should be
/Park/PMpage.jsp -- notice that you're spelling it wrong, too, if the latest post is correct.  If the file is PMpage.jsp, then PMPage.jsp will not exist.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:aentice
ID: 20377336
I tried that too. When I add /Park/PMpage.jsp the link becomes Park/Park/PMPage.jsp instead to just one Park it becomes 2.
0
 

Author Comment

by:aentice
ID: 20377572
I tried one that worked, but it should not be done this way. I moved the page under WEB-INF and mixed it together with the other pages, it seems like it cannot find the Park folder and I'm not sure how the structure works.
0
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 20379217
Okay -- the good news is that you now have a URL you can use to reference your JSP pages.

Now it sounds as if you need to figure out what your Web site structure is so that you can make URLs that refer to other files (not in WEB-INF).

Are you able to retrieve the files in your/Park/images directory?  If so, what do those URLs look like?

If href="/Park/PMPage.jsp" turns into "/Park/Park/PMPage.jsp" then there could be several things going on.

1) /Park is the location of your web app under http://mydomain.com, so that all of your webapp is http://mydomain.com/Park/something

2) You have a base directory declared in the HTML of your page, and that base directory is /Park.

Other things might cause what you're seeing, too , but these are the ones that occur to me.

If /Park is prefixed to all of your URLs, then did you try
href="/PMPage.jsp"
0
 
LVL 11

Expert Comment

by:Manish
ID: 20379787
check you context root in ear.
add context root to jsp path
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
rebasing and merging used in SCM 1 78
lessBy10  challenge 15 95
Market Place not working in Eclipse Luna 2 118
iterator/ListIterator approach 17 39
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question