`
yexin218
  • 浏览: 971007 次
  • 性别: Icon_minigender_1
  • 来自: 珠海
社区版块
存档分类
最新评论

different between<A Href> and <jsp: forward>

    博客分类:
  • Jsp
阅读更多

i want to access Servelt by hyperlink in a jsp web site
connection.jsp

<%@ page contentType="text/html;charset=GB2312"

 %>
<HTML>
<BODY bgcolor=cyan><Font size=1>
<A Href="/myjsp/Hello"

 >Accessing servlet<A>
</BODY>
</HTML


i put the bean in the dir(/myjsp/WEB-INF/classes/hello(package)/Hello)
and modify the file web.xml like this:

><servlet>
        <servlet-name>Hello</servlet-name>
        <servlet-class>hello.Hello</servlet-class>
    </servlet>
    <servlet-mapping>
  	<servlet-name>Hello</servlet-name>
  	<url-pattern>/Hello</url-pattern>
    </servlet-mapping>



it works!
but if i use <jsp:forward>

<html>
	<body bgcolor="green"

>
	
	<jsp:forward page="/myjsp/Hello"

 />
	<body>
</html>



it causes an Exception The requested resource (/myjsp/myjsp/SimpleServlet) is not available.

but if you rewrite the path like this <jasp:forward page="/Hello"/>
it will be ok.   why?
in my opinion, if you use <A Href=..> the default path is http://localhost:8080
so you need the rest path is /myjsp/Hello. but if you use <jsp:forward> the default path is http://localhost:8080/myjsp/,so you just need write the rest part"/Hello".
i don't know my explaination is right or not. but i think this is a try.

分享到:
评论

相关推荐

    Flash Sample

    &lt;br&gt;Interactive animation: Sliders&lt;br&gt;Control the motion of a beetle using sliders.&lt;br&gt; &lt;br&gt;Basics: Radians and degrees&lt;br&gt;Compare the difference between radians and degrees.&lt;br&gt; &lt;br&gt;Basics: Movie ...

    C++ Standard Library: A Tutorial and Reference

    Input/Output Using Stream Classes&lt;br/&gt;&lt;br/&gt;13.1 Common Background of I/O Streams&lt;br/&gt;&lt;br/&gt;13.2 Fundamental Stream Classes and Objects&lt;br/&gt;&lt;br/&gt;13.3 Standard Stream Operators &lt;&lt; and &gt;&gt;&lt;br/&gt;&lt;br/&gt;13.4 ...

    Cisco IP Telephony: Planning, Design, Implementation, Operation, and Optimization

    as shown by the experts.&lt;br&gt;&lt;br&gt;Understand how to work through the different implementation phases of a Cisco IP telephony solution&lt;br&gt;Plan your implementation with tools and guides from the most ...

    DIHtmlParser v7.9.0 for D10.1 Berlin

    Scripts: DIHtmlParser returns the contents between the &lt;SCRIPT&gt; and &lt;/SCRIPT&gt; tags as simple text. The surrounding HTML tags are reported separately. Styles: DIHtmlParser returns the contents between ...

    cuteEditor6.0

    You can also create your own policy files that define arbitrary permission sets.&lt;br/&gt;&lt;br/&gt;Comparison of the sample security policy file &lt;br/&gt;&lt;br/&gt; &lt;br/&gt;Permissions/Resource Setting Admin Default ...

    IMAGE and VIDEO COMPRESSION for MULTIMEDIA ENGINEERING Fundamentals, Algorithms, and Standards.part1.rar

    2000 by CRC Press LLC&lt;br&gt;&lt;br&gt; &lt;br&gt; &lt;br&gt;5.1.1 Coding an Information Source&lt;br&gt;5.1.2 Some Desired Characteristics&lt;br&gt;5.1.3 Discrete Memoryless Sources&lt;br&gt;5.1.4 Extensions of a Discrete Memoryless Source...

    Mpeg2_Decoder

    The directory verify/ contains&lt;br&gt;a small set of verification pictures, a small bitstream, and Unix &lt;br&gt;shell script to automatically test the output of the encoder and decoder.&lt;br&gt;&lt;br&gt;A precompiled ...

    The Art of Assembly Language Programming

    Some Final Comments on the MOV Instructions&lt;br&gt;&lt;br&gt;4.9 Laboratory ...and CodeView'&lt;br&gt;4.9.5.1 A Quick Look at CodeView&lt;br&gt;4.9.5.2 The Source Window&lt;br&gt;4.9.5.3 The Memory Window&lt;br&gt;4.9.5.4 The Register ...

    SBPL Programming Reference for GL408e_GL412e

    - `&lt;ESC&gt;A`: Starts a new label. - `&lt;ESC&gt;~A`: Cuts the current label. - `&lt;ESC&gt;~a`: Cuts the current job. - `&lt;ESC&gt;~B`: Cuts the last label. - `&lt;ESC&gt;AO`: Enables auto-online mode. - `&lt;ESC&gt;A1`: Sets...

    Using Assemblies in Microsoft .NET and C# Using Assemblies in Microsoft .NET and C#

    Version Global Assemblies&lt;br&gt;&lt;br&gt;Attributes&lt;br&gt;Compile/Link and Load into GAC&lt;br&gt;Same Name but Different Versions&lt;br&gt;Correct Version Required&lt;br&gt;&lt;br&gt;11. Appendix&lt;br&gt;&lt;br&gt;Commandfile to Build Sample ...

    Using Assemblies in Microsoft .NET and C#

    Version Global Assemblies &lt;br&gt;&lt;br&gt;Attributes&lt;br&gt;Compile/Link and Load into GAC&lt;br&gt;Same Name but Different Versions&lt;br&gt;Correct Version Required &lt;br&gt;&lt;br&gt;11. Appendix &lt;br&gt;&lt;br&gt;Commandfile to Build Sample...

    Apress.Pro.LINQ.Language.Integrated.Query.in.C.Sharp.2008.Nov.2007.eBook-BBL

    November 19, 2007&lt;br&gt; The size of the release is: 03 disks x 2.88mb&lt;br&gt; And released on: 12/22/2007&lt;br&gt;&lt;br&gt;===================================================&lt;br&gt; LINQ is the project name for a set ...

    Visual C++ 编程资源大全(英文源码 其它)

    40.zip&lt;br&gt;Getting rid of Window List from MDI applications&lt;br&gt;在MDI应用中去掉窗口列表(5KB)&lt;END&gt;&lt;br&gt;41,41.zip&lt;br&gt;Save and Restore&lt;br&gt;存储和恢复(7KB)&lt;END&gt;&lt;br&gt;42,42.zip&lt;br&gt;A Quick Start&lt;br&gt;使用微软本地化...

    Import REConstructor 1.7 FINAL

    you should be familiar a bit with manual unpacking first (some tutorials are easy to find on internet).&lt;br&gt;&lt;br&gt;Features:&lt;br&gt;&lt;br&gt;- Imports&lt;br&gt;- An original tree view&lt;br&gt;- 2 different methods to find ...

    VB编程资源大全(英文源码 表单)

    and will provide Up and/or Dn graphics to enable navigation between the menu sections.&lt;END&gt;&lt;br&gt;40 , CoolExplorer2.zip&lt;br&gt;The new and improved Cool Explorer: Many new functions.&lt;END&gt;&lt;br&gt;41,...

    Visual C++ 编程资源大全(英文源码 控件)

    1,01.zip&lt;br&gt;3D Text&lt;br&gt;显示3D文字(6KB)&lt;END&gt;&lt;br&gt;2,02.zip&lt;br&gt;A button within a button&lt;br&gt;按纽中的按纽(13KB)&lt;END&gt;&lt;br&gt;3,03.zip&lt;br&gt;Flat Owner Drawn Buttons&lt;br&gt;浮动的自画按纽(13KB)&lt;END&gt;&lt;br&gt;4,04.zip&lt;br&gt;Flat-...

    Visual C++ 编程资源大全(英文源码 表单)

    27.zip&lt;br&gt;Simple way to change dialog's background and text colors&lt;br&gt;改变对话框背景颜色和文字颜色的简单途径(11KB)&lt;END&gt;&lt;br&gt;28,28.zip&lt;br&gt;A Simple Dialog Layout Manager&lt;br&gt;一个简单的对话框设计管理器(19...

    Visual C++ 编程资源大全(英文源码 系统)

    Sync.zip&lt;br&gt;Synchronizing worker threads using 3 different methods(61KB)&lt;END&gt;&lt;br&gt;56,PStat_src.zip&lt;br&gt;A Freeware generalized framework for executing a lengthy operation in a thread.(20KB)&lt;END&gt;&lt;br&gt;57,...

Global site tag (gtag.js) - Google Analytics