This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Login application B from application A  RSS feed

Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have application A (A.war) and application B (B.war) deployed in my JBoss server. There is a page at application A that I can choose a product and click the button GO. And it is supposed to direct me to the login page at application B. The product information needs to be carried on to the login page.

Currently I am using HttpURLConnection to send a request to the servlet bServlet at application B. And I got the following exception: http://localhost:8080/B/bServlet
at Source)
at productServlet.doPost(

Line 250: BufferedReader brd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line = null;
StringBuffer sb = new StringBuffer();
while ((line = brd.readLine()) != null) {
// Process line...
System.out.println(">>>received: " + line );
sb.append( line );

I think the reason of the exception thrown is that the bServlet doesn't have a output stream to write back to productServlet. But if I comment out the above code, it seems bServlet doesn't receive the request since the testing printout at bServlet doesn't show up. How should I solve this problem?

Are there any other ways to implement what I describe at the first paragraph? Thank you.

PS. When I put http://localhost:8080/B/bServlet at the url of the browser, it shows the information correctly.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!