Solved

a href link in JSP

Posted on 2007-11-29
7
23,613 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fisheye tool 2 111
servlet cookie finding by name 1 79
authenticate preemptively soap ui option 3 143
struts exact match support 3 56
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
The question appears often enough, how do I transfer my data from my old server to the new server while preserving file shares, share permissions, and NTFS permisions.  Here are my tips for handling such a transfer.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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