hi,
i deployed a webapplication(wapp1) having input.html and a servlet(Servlet1) in tomcat web server. The form input.html just accepts a text and when u click on the button click the request is sent to servlet in wapp1. The request is redirected to a servlet(Servlet2) which is in a webapplication(wapp2) deployed on weblogic application server...the response is given to the browser using servlet in wapp2 deployed in weblogic server...but when i try to do this i get java.lang.NullPointerException...
The code is here...[CODE]
import javax.servlet.;
import javax.servlet.http.
;
import java.io.*;

public class Servlet1 extends HttpServlet{

public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
    String s1=req.getParameter("uname");
    res.sendRedirect("http://localhost:7001/wapp2/srv2?user="+s1);
}//end of doGet

}

[/CODE]
web.xml is here for first servlet in tomcat
[CODE]
<web-app>
<servlet>
<servlet-name>dum</servlet-name>
<servlet-class>Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dum</servlet-name>
<url-pattern>/srv1</url-pattern>
</servlet-mapping>
</web-app>

//and this is input.html in web application 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>

<BODY>
<center>
<h2>
<form action="srv1">
Username:<input type=text name="uname"><br>
<input type=submit value="click">
</form>
</h2>
</center>

</BODY>
</HTML>
[/CODE]

The above code is in wapp1 deployed in tomcat server.

The following code is in web application deployed in weblogic server
[CODE]
import javax.servlet.;
import javax.servlet.http.
;
import java.io.*;
public class Servlet2 extends HttpServlet{

public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
    PrintWriter pw=res.getWriter();
    String s=req.getParameter("user");
    pw.println("welcome "+s);
    pw.close();
}//end of doGet

}
//the web.xml for this servlet
<web-app>
<servlet>
<servlet-name>dum</servlet-name>
<servlet-class>Servlet2</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dum</servlet-name>
<url-pattern>/srv2</url-pattern>
</servlet-mapping>
</web-app>

[/CODE]
The exception is [quote]
Error 500--Internal Server Error
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:389)
at weblogic.servlet.internal.WebAppServletContext.setAttribute(WebAppServletContext.java:669)
at Servlet2.doGet(Servlet2.java:11)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at ...

[QUOTE=qutejose;1132219]Does J2EE support Enterprise applications?

Is Java Beans an application dependent components?

Does JavaBeans support sharing among the network?

1 Javabean can contain how many classes?

Does Servlets execution starts with main methods?[/QUOTE]

servlets doesnt start with main method....servlet has lifecycle methods which are executed by a web server or an application server....for resource like a servlet you deploy in the server the container(an application contained in a server)takes care of servlet...it creates object of the servlet...and provides the service.....The life cycle methods of a servlet are
public void init(arguments);
public void service(arguments);
public void destroy();
to find more about servlets see the j2ee api...that should tell you more about it....

well a java bean is a class which has getter and setter methods...with fields which are private...
J2EE technologies like(servlets,jsp,EJB(for n-tier applications)) are exclusive for enterprise applications.....

jwenting commented: don't help homework kiddos -2
peter_budo commented: Ignoring forum rule "We only give homework help to those who show effort" bad -2

Hey dude....
i will try to develop the application for you....give me a clearcut specifications of what you want me to develop and what java technologies(JEE) you want me to use....or is it just enough if i use J2SE core concepts....make sure you give me a full description of the problem....dont give me some form of vague description of the problem....hurry up....mail the problem to [I]<<Email Snipped>>[/I]
all the best...

javaAddict commented: Do you even know the purpose of this forum? -1
__avd commented: Read post #2 -1
Ezzaral commented: What do you think he will learn for that -2

Hey Mr.BestJew you need not tell me to google or not google before posting a thread.......stop giving ur crap suggestions.....its upto me to post the thread or not....

jwenting commented: insulting other members isn't going to make you friends. -2
stultuske commented: it's not a "crap suggestion" at all -1

Why java doesn't support multiple inheritance?thank you....