struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: struts problems with usual links
Date Tue, 03 Jun 2003 07:12:37 GMT
use <html:link page="/xxx"> (instead of href)

Nico.



Hi,

I´ve got Problems with struts Links.I loose the name of the webapp if I put "/" before the
url. (I´m using tomcat)
 http://localhost:8082/WEBAPP_NAME/shop/basket/add wird z.B. http://localhost:8082/shop/basket/add.do
And if I don´t use a "/" in my link the link changes from
http://localhost:8082/WEBAPP_NAME/shop/basket/add  to
http://localhost:8082/WEBAPP_NAME/shop/basket/add/shop/basket/add.do

The html Code looks like this
<html:link href="/shop/basket/add.do" target="content">1 -Add to basket</html:link><br>
<html:link href="shop/basket/add.do" target="content">1 -Add to basket</html:link><br>

I just want a link which looks like this:
 http://localhost:8082/WEBAPP_NAME/shop/basket/add.do

How can I do this?


Part of STRUTS-CONFIG.XML

  <action  path="/shop/inventory/detail"
              type="de.proway.hsvv.shop.control.shop.InventoryAction"

              scope="request"
              parameter="detail">
    <forward  name="done"      path="/shop/inventory/detail.jsp"/>
  </action>

  <action     path="/shop/inventory/list"
              type="de.proway.hsvv.shop.control.shop.InventoryAction"

              scope="request"
              parameter="list">
    <forward  name="done"      path="/shop/inventory/inventory.jsp"/>
  </action>

  <action     path="/shop_basket_add"
              type="de.proway.hsvv.shop.control.shop.BasketAction"

              scope="request"
              parameter="add">
    <forward  name="done"      path="/shop/basket/view.jsp"/>



JSP Page

<%@ page import="java.util.*, java.text.*" %>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld"  prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>

<html>
<head>
<title></title>
<link rel="stylesheet" href="css/main.css" type="text/css">
</head>
<body>
<center>
<form>
shop/inventory.jsp
<html:link href="/shop/basket/add.do" target="content">1 -Add to basket</html:link><br>
<html:link href="shop/basket/add.do" target="content">1 -Add to basket</html:link><br>
<a href="shop/inventory/details.do" target="content">2 detail view</a><br>
<a href="./shop/inventory/details.do" target="content">3 detail view</a>
</form>
</center>
</body>
</html>






---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message