How to get result from another JSP file?

I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).

The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.

How can I call other.jsp to get the result? Thanks a lot.

[386 byte] By [myra_chen] at [2007-9-18]
# 1
<jsp:include page="other.jsp" flush="true" />You should include this line of code yin your my.jsp file. This will include the response generated be the other.jsp in the my.jsp file
aqb75 at 2007-7-4 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2

hi, you can put all the information into a <form method="post" action="other.jsp"> (this will call other.jsp from my.jsp when you do submit).

then in other.jsp you do

First you have to put the information you will need at other.jsp into <input type="hidden" name="id_house">

String name = request.getParameter("id_house");

if you have another doubt my email is frozados@fibertel.com.ar

frozados at 2007-7-4 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi, I think I didn't describe the problem clearly enough. In fact, there is a JSP file, and if our database is currently connected, the JSP will return value 1, otherwise, it will return 0. My java program need to get that result, and then form an XML string, and send the string back to the client. I'm just wonder how can I write such a program to read result from JSP file. Thanks a lot.

myra_chen at 2007-7-4 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 4
read the http response from the web server then you should be able to redirect your process in the direction neeeded either it's a 1 or a 0
leviking at 2007-7-4 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 5

> Hi, I think I didn't describe the problem clearly

> enough. In fact, there is a JSP file, and if our

> database is currently connected, the JSP will return

> value 1, otherwise, it will return 0. My java program

> need to get that result, and then form an XML string,

> and send the string back to the client. I'm just

> wonder how can I write such a program to read result

> from JSP file. Thanks a lot.

Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

DrClap at 2007-7-4 > top of java,Enterprise & Remote Computing,Web Tier APIs...