struts2-20070511-2

I changed the result-name from '/myexample/HelloWorld.jsp' to '/myexample/a.pdf' and add a new file in  myexample folder.But no use.

In the documents ,there are some words: 

Based on the mappings loaded from the struts.xml, a given result-name may select a page (as in this example), another action, or some other web resource (image, PDF).  

I have not known why yet.

--------------------------------------------
Using Tags
------------------------------------
Linking->
<ul>
   
<li>
      
<s:url id="url" action="HelloWorld">
         
<s:param name="request_locale">en</s:param>
      
</s:url>
      
      
<s:a href="%{url}">English</s:a>
      
   
</li>
   
<li>
      
<s:url id="url" action="HelloWorld">
         
<s:param name="request_locale">es</s:param>
      
</s:url>
      
      
<s:a href="%{url}">Espanol</s:a>
   
</li>
</ul>
%{url} will be evaluated to the url defined with the s:url tag.

There are three kinds of link
· Resource links
<link href="<s:url value="/css/tutorial.css"/>
  rel="stylesheet" type="text/css"/>

·Direct links
<li><href="<s:url action="Register"/>">Register</a></li>
·Links with paramenters
<s:url id="url" action="Welcome">
  
<s:param name="request_locale">en</s:param>
</s:url>
<s:a href="%{url}">English</s:a>
The param tag will add the parameter "?request_locale=en" to the Welcome Action URL.
Any number of parameters can be added to the URI by adding more param etags.
----------------------------
Why the uri is http://localhost:8080/blank/myexample/HelloWorld.action.   Where the 'myexample' is defined?
How this code works?
<action name="*" >
  
<result>/tutorial/{1}.jsp</result>
</action>


posted on 2007-05-11 17:06 deepbluesea 阅读(163) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 
<2007年5月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

公告

MSN:zzlljj8833@hotmail.com lava:5832911

常用链接

留言簿(1)

随笔分类(9)

随笔档案(18)

文章分类(1)

文章档案(1)

搜索

最新评论

阅读排行榜

评论排行榜