Hyperlinks & JSP?


Web tier: servlets, JSP, Web frameworks: Hyperlinks & JSP?

  1. Hyperlinks & JSP? (1 messages)

    Hiya all

    On my jsp page I have

    c:import url="../xml/car_specs.xml" var="pgeXML" scope="page"

    and on my html page I have

    a href="jsp/car_specs.jsp">Car Specs

    This is ok but for every page i want to link to i need a new jsp page and have have to change the import url (btw i have about another 10 pages which i wish to link to). Is there a way i can use jsp so that i only have one jsp page but dynamically change the import url depending on the link clicked?


    Threaded Messages (1)

  2. Hyperlinks & JSP?[ Go to top ]

    Could you use a request parameter?

    JSP (xml_import.jsp):

    c:import url="../xml/<%=request.getParameter("view")%>" var="pgeXML" scope="page"

    c:import url="../xml/${param.view}" var="pgeXML" scope="page"


    a href="jsp/xml_import.jsp?view=car_specs.xml">Car Specs