-
1. Re: how to compile servlet code ???
nickarls Mar 27, 2013 3:01 AM (in response to pradhumnjboss)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 ???
pradhumnjboss Mar 27, 2013 9:45 AM (in response to nickarls)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 ???
nickarls Mar 27, 2013 11:30 AM (in response to pradhumnjboss)Well, the servlet api has to be available when you compile, no matter how you do it
-
4. Re: how to compile servlet code ???
ybxiang.china Mar 28, 2013 12:11 AM (in response to pradhumnjboss)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 ???
pradhumnjboss Apr 7, 2013 12:58 PM (in response to ybxiang.china)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 ???
ybxiang.china Apr 8, 2013 8:29 AM (in response to pradhumnjboss)you have too much to learn!
-
7. Re: how to compile servlet code ???
pradhumnjboss Apr 8, 2013 1:53 PM (in response to ybxiang.china)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 ???
nickarls Apr 8, 2013 2:05 PM (in response to pradhumnjboss)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 ???
ybxiang.china Apr 9, 2013 6:56 AM (in response to nickarls)Agree with Nicklas.
-
10. Re: how to compile servlet code ???
ybxiang.china Apr 9, 2013 7:04 AM (in response to pradhumnjboss)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!