`
yexin218
  • 浏览: 958504 次
  • 性别: 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 ...

    Sam's Teach Yourself Data Structures And Algorithms In 24 Hours

    Three things:&lt;br/&gt;● Our primary goal in writing this book is to make the topics we cover easy to understand.&lt;br/&gt;● Demonstration programs called Workshop applets bring to life the topics we cover,...

    Designing a Wireless network

    wan_toc 6/22/01 4:54 PM Page xvii&lt;br&gt;Contents xvii&lt;br&gt;Developing WPANs through the 802.15&lt;br&gt;Architecture 143&lt;br&gt;Bluetooth 144&lt;br&gt;HomeRF 147&lt;br&gt;High Performance Radio LAN 147&lt;br&gt;Mobile Wireless ...

    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...

    Teach Yourself Electricity & Electronics

    analog conversion 509&lt;br&gt;Digital signal processing 510&lt;br&gt;The principle of signal mixing 511&lt;br&gt;The product detector 512&lt;br&gt;The superheterodyne 515&lt;br&gt;A modulated-light receiver 517&lt;br&gt;Quiz 517&lt;br&gt;28 ...

    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 ...

    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...

    Agile Software Development Quality Assurance

    Agile methods are a collection of different techniques and practices that share the same values and basic principles. Agile Software Development Quality Assurance provides in-depth coverage of the ...

    Fourier Analysis on Finite Groups with Applications in Signal Processing and System Design

    &lt;br&gt;&lt;br&gt;A solid foundation of this complex topic is provided by beginning with a review of signals and their mathematical models and Fourier analysis. Next, the book examines recent achievements and ...

    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 ...

Global site tag (gtag.js) - Google Analytics