- This topic has 3 replies, 2 voices, and was last updated 19 years, 8 months ago by Riyad Kalla.
-
AuthorPosts
-
odessaMemberI have a webapp that I am trying to deploy to resin 3.0.10 on windows. I have some JSPs and some servlets. In MyEclipse, I have the following structure:
WebAppProject
–src
—-com.test.servlets
——-TestServlet.java
–WebRoot
—-WEB-INF
——classes
———com…
——web.xml
—-htdocs
——test.jspBasically, I am trying to deploy com.test.servlets.TestServlet.java and test.jsp to resin. I am confused what I should have in resin.conf and web.xml
I want to be able to hit http://localhost:8080/test.jsp. That JSP page invokes a servlet com.test.servlets.TestServlet.java
Thanks.
Riyad KallaMemberYour MyEclipse project looks setup fine, what you need to do is edit your project preferences go to MyEclipse-Web and change your Web Context Root to “/”, that will deploy the app to your ROOT context, so you can access it via the URL below.
Normally you would give a name like “myapp” and then you would access it via: http://localhost:8080/myapp/test.jsp, but if this is the ONLY app your application server will be hosting, then you can deploy it to the root app to make the URL shorter if you wish.
odessaMemberI am not sure what option you are refering to. Is it in MyEclipse/J2EE Project/Project Templates?
Ideally, I want to be able to deploy more than one app to resin in my dev environment.
Here is what I have in my resin.conf:
<host id=”” root-directory=”.”>
<web-app id=’/’ document-directory=”deploy/test/htdocs”> <!–works for JSPs–>
<servlet servlet-name=”LoginServlet” servlet-class=”com.test.servlet.LoginServlet”/>
<servlet-mapping servlet-name=”LoginServlet”
url-pattern=”servlet/LoginServlet”/>
</web-app>
</host>My app is deployed into RESIN_HOME/deploy folder. When I hit http://localhost:8080/test/htdocs/test.jsp it works, When I hit http://localhost:8080/servlet/LoginServlet i get 500 error and a message in the log says “com.test.servlet.LoginServlet’ is not a known servlet. Servlets belong in the classpath, often in WEB-INF/classes.” On the file system, my servlet is in: D:\resin-3.0.10\deploy\WebAppProject\WEB-INF\classes\com\zedo\servlet
I don’t understand why my jsp works and servlet doesn’t. Must be something wrong in resin.conf.
Riyad KallaMemberI am not sure what option you are refering to. Is it in MyEclipse/J2EE Project/Project Templates?
Project properties, right click on your proejct root and go to Properties, then MyEclipse-Web
Ideally, I want to be able to deploy more than one app to resin in my dev environment.
The example you gave above had you deploying to the ROOT, if you wish to instead deploy to a subdir then use a name for your context root other than “/”, something like “/myapp”.
Here is what I have in my resin.conf:
I am not farmiliar with Resin, you will have to check out their docs to see if this is what you want.
I don’t understand why my jsp works and servlet doesn’t. Must be something wrong in resin.conf.
You are using different URLs, to access your servlet try: http://localhost:8080/test/servlet/LoginServlet
-
AuthorPosts