You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Olszynski <m....@proway.de> on 2003/06/03 08:47:06 UTC
struts problems with usual links
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>
Re: struts problems with usual links
Posted by Michael Olszynski <m....@proway.de>.
Thank you very much!
That´s working! :-)
----- Original Message -----
From: "Nicolas De Loof" <ni...@cgey.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, June 03, 2003 9:12 AM
Subject: Re: struts problems with usual links
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: struts problems with usual links
Posted by Nicolas De Loof <ni...@cgey.com>.
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