-
1. Re: how to compile servlet code ???
Nicklas Karlsson Mar 27, 2013 3:01 AM (in response to KB OSS)Servlet code is normal java code and is usually compiled in the building process. What build tool are you using and what errors are you seeing?
If you are new to java, I recommending googling for some general tutorials first.
-
2. Re: how to compile servlet code ???
KB OSS Mar 27, 2013 9:45 AM (in response to Nicklas Karlsson)i used to compile servlet in tomcat .
but in jboss as 7 as i mentioned above ,i used that way , not eclipse
so the code gave error on importing statement JAVAX.SERVLET.* , HttpServlet (while extending it) & others related to servlet
i compiled this on jdk1.6/bin.
-
3. Re: how to compile servlet code ???
Nicklas Karlsson Mar 27, 2013 11:30 AM (in response to KB OSS)Well, the servlet api has to be available when you compile, no matter how you do it
-
4. Re: how to compile servlet code ???
xiang yingbing Mar 28, 2013 12:11 AM (in response to KB OSS)1 of 1 people found this helpfulAnt javac compile is easy too:
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.ybxiang.nms.manager" default="exportAPI" basedir=".">
<property name="jboss.home" value="D:/java/jboss-as-7.2.0.Final"/>
<property name="jboss.conf.dir" value="D:/java/jboss-as-7.2.0.Final/standalone/configuration"/>
<property name="war.source.dir" value="${basedir}/ybxiang-forum-war/src"/>
<property name="war.classes.dir" value="${basedir}/ybxiang-forum-war/build/classes"/>
<property name="ybxiang-forum-ejb-classes" value="${basedir}/ybxiang-forum-ejb/build/classes" />
<property name="jboss-ejb-api_3.1_spec" value="D:/java/jboss-as-7.2.0.Final/modules/system/layers/base/javax/ejb/api/main/jboss-ejb-api_3.1_spec-1.0.2.Final.jar"/>
<property name="jboss-jsf-api_2.1_spec" value="D:/java/jboss-as-7.2.0.Final/modules/system/layers/base/javax/faces/api/main/jboss-jsf-api_2.1_spec-2.1.18.Final.jar"/>
<property name="jboss-servlet-api_3.0_spec" value="D:/java/jboss-as-7.2.0.Final/modules/system/layers/base/javax/servlet/api/main/jboss-servlet-api_3.0_spec-1.0.2.Final.jar"/>
<target name="war.recompile">
<delete dir="${war.classes.dir}/com"/>
<javac srcdir="${war.source.dir}" destdir="${war.classes.dir}" >
<classpath>
<!-- http://ant.apache.org/manual/using.html -->
<pathelement location="${ybxiang-forum-ejb-classes}"/>
<pathelement location="${jboss-ejb-api_3.1_spec}"/>
<pathelement location="${jboss-jsf-api_2.1_spec}"/>
<pathelement location="${jboss-servlet-api_3.0_spec}"/>
</classpath>
<!--
<include name="**/*.java"/>
<exclude name="**/Example.java"/>
-->
</javac>
</target>
</project>
-
5. Re: how to compile servlet code ???
KB OSS Apr 7, 2013 12:58 PM (in response to xiang yingbing)thank you sir.
but i also want to see how build this means <java> tag in build.xml file for servlet
THANKS
-
6. Re: how to compile servlet code ???
xiang yingbing Apr 8, 2013 8:29 AM (in response to KB OSS)you have too much to learn!
-
7. Re: how to compile servlet code ???
KB OSS Apr 8, 2013 1:53 PM (in response to xiang yingbing)Actually my platform is Tomcat so can you give me some suggestion how to complite my basics..
THANKS.
-
8. Re: how to compile servlet code ???
Nicklas Karlsson Apr 8, 2013 2:05 PM (in response to KB OSS)I think what Xiang is trying to say (and actually myself a few posts back) is that perhaps you would need to find some general java/web application tutorials first so that you can ask more specific and relevant questions. This is the forums for JBoss AS and your questions are a bit vague and general. Have you tried http://www.javaranch.com/ ? (it's more professional than the front page might indicate) ;-)
-
9. Re: how to compile servlet code ???
xiang yingbing Apr 9, 2013 6:56 AM (in response to Nicklas Karlsson)Agree with Nicklas.
-
10. Re: how to compile servlet code ???
xiang yingbing Apr 9, 2013 7:04 AM (in response to KB OSS)Suggestion:
You must know what java is:
Here is the turorial: http://www.avajava.com/tutorials/categories/java-basics
(1) Learn how to use IDE(for example, eclipse) to develop web applications at first.
Here is the turorial: http://www.avajava.com/tutorials/categories/eclipse
(2) Learn Servlet/JSP/JSF knownedge:
http://www.avajava.com/tutorials/categories/servlets
http://www.avajava.com/tutorials/categories/jsps
(3) Study the web container at last:
http://www.avajava.com/tutorials/categories/tomcat
If you speak English, maybe job of coding is not suitable for you.
If you speak Chinese, there are too many books/web pages discussing java, tomcat, jsp, servlet. Yes, too many!