Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

a href link in JSP

Posted on 2007-11-29
7
Medium Priority
?
24,939 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 1500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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