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.
分享到:
相关推荐
<br>Interactive animation: Sliders<br>Control the motion of a beetle using sliders.<br> <br>Basics: Radians and degrees<br>Compare the difference between radians and degrees.<br> <br>Basics: Movie ...
Input/Output Using Stream Classes<br/><br/>13.1 Common Background of I/O Streams<br/><br/>13.2 Fundamental Stream Classes and Objects<br/><br/>13.3 Standard Stream Operators << and >><br/><br/>13.4 ...
Three things:<br/>● Our primary goal in writing this book is to make the topics we cover easy to understand.<br/>● Demonstration programs called Workshop applets bring to life the topics we cover,...
wan_toc 6/22/01 4:54 PM Page xvii<br>Contents xvii<br>Developing WPANs through the 802.15<br>Architecture 143<br>Bluetooth 144<br>HomeRF 147<br>High Performance Radio LAN 147<br>Mobile Wireless ...
as shown by the experts.<br><br>Understand how to work through the different implementation phases of a Cisco IP telephony solution<br>Plan your implementation with tools and guides from the most ...
Scripts: DIHtmlParser returns the contents between the <SCRIPT> and </SCRIPT> tags as simple text. The surrounding HTML tags are reported separately. Styles: DIHtmlParser returns the contents between ...
You can also create your own policy files that define arbitrary permission sets.<br/><br/>Comparison of the sample security policy file <br/><br/> <br/>Permissions/Resource Setting Admin Default ...
2000 by CRC Press LLC<br><br> <br> <br>5.1.1 Coding an Information Source<br>5.1.2 Some Desired Characteristics<br>5.1.3 Discrete Memoryless Sources<br>5.1.4 Extensions of a Discrete Memoryless Source...
analog conversion 509<br>Digital signal processing 510<br>The principle of signal mixing 511<br>The product detector 512<br>The superheterodyne 515<br>A modulated-light receiver 517<br>Quiz 517<br>28 ...
The directory verify/ contains<br>a small set of verification pictures, a small bitstream, and Unix <br>shell script to automatically test the output of the encoder and decoder.<br><br>A precompiled ...
Some Final Comments on the MOV Instructions<br><br>4.9 Laboratory ...and CodeView'<br>4.9.5.1 A Quick Look at CodeView<br>4.9.5.2 The Source Window<br>4.9.5.3 The Memory Window<br>4.9.5.4 The Register ...
Version Global Assemblies<br><br>Attributes<br>Compile/Link and Load into GAC<br>Same Name but Different Versions<br>Correct Version Required<br><br>11. Appendix<br><br>Commandfile to Build Sample ...
Version Global Assemblies <br><br>Attributes<br>Compile/Link and Load into GAC<br>Same Name but Different Versions<br>Correct Version Required <br><br>11. Appendix <br><br>Commandfile to Build Sample...
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 ...
<br><br>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 ...
November 19, 2007<br> The size of the release is: 03 disks x 2.88mb<br> And released on: 12/22/2007<br><br>===================================================<br> LINQ is the project name for a set ...
40.zip<br>Getting rid of Window List from MDI applications<br>在MDI应用中去掉窗口列表(5KB)<END><br>41,41.zip<br>Save and Restore<br>存储和恢复(7KB)<END><br>42,42.zip<br>A Quick Start<br>使用微软本地化...
you should be familiar a bit with manual unpacking first (some tutorials are easy to find on internet).<br><br>Features:<br><br>- Imports<br>- An original tree view<br>- 2 different methods to find ...