here is the bean include
<%
String xxxUrl = "codeTypeToolbar.jsp?action=codeTypeList&codeTypeIdParam="+codeTypeIdParam;
%>
<bean:include id="xxx" page="<%=xxxUrl%>"/>
<bean:write name="xxx"/>
which gives me java.net.UnknownHostException, the port number is messed up as servername, servername seems to be fine


When I tried the following scriptlet in jsp page directly,
it thows java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: 'servername: port' although if I print the servername and port, the values are right.



<%
String urlStr = "codeTypeToolbar.jsp?action=codeTypeEdit&codeTypeIdParam="+codeTypeIdParam;
Map params = new HashMap();
params.put("action","codeTypeList");
params.put("action",codeTypeIdParam);
String urlString = null;
URL url = null;
try {
urlString =
RequestUtils.computeURL(pageContext, null, null, urlStr, params, null, false);
if (urlString.indexOf(':') < 0) {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
url = new URL(RequestUtils.requestURL(request), urlString);
} else {
url = new URL(urlString);
}
} catch (MalformedURLException e) {
RequestUtils.saveException(pageContext, e);
}
URLConnection conn = null;
try {
// Set up the basic connection
conn = url.openConnection();
System.out.println(". conn = " + conn);
System.out.println(". host = " + conn.getURL().getHost());
System.out.println(". path = " + conn.getURL().getPath());
System.out.println(". port = " + conn.getURL().getPort());
conn.setAllowUserInteraction(false);
conn.setDoInput(true);
conn.setDoOutput(false);
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
if ((conn instanceof HttpURLConnection)
&& urlString.startsWith(request.getContextPath())
&& (request.getRequestedSessionId() != null)
&& request.isRequestedSessionIdFromCookie()) {
StringBuffer sb = new StringBuffer("JSESSIONID=");
sb.append(request.getRequestedSessionId());
conn.setRequestProperty("Cookie", sb.toString());
}
conn.connect();
}
catch(Exception eee)
{
System.out.println("Exception xxxxxxxxxxxxxxxxxxxxxxxxx conn.open\n"+ eee.toString());
eee.printStackTrace();
}
%>


From: "James Mitchell" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: bean:include doesn't work but jsp:include does[Scanned]
Date: Wed, 18 May 2005 18:49:19 -0400

What would you like me to email to you?  The answer?

If yes, I need more information.

Let's back up for just a minute. What are you doing that requires you to bean:include a url from your own application?

I wrote most (thousands) of the cactus tests that cover most of the Struts Taglibs, and I don't recall ever seeing an issue with bean:include other than how the url is built in the Cactus environment (Cactus' request wrapper). It is sometimes returning the wrong port, which makes automated testing impossible, but that's another story for another day ;)


What problems are you seeing? Errors on the page? Errors in the log?

What have you tried in terms of trouble shooting? You mentioned opening an HttpConnection (I'm assuming with HttpClient). Did you verify the call, say from an Action? Did you try forcing the include from your action via a RequestDispatcher call?

What about JSTL?  Did you try c:url?  What happened?

Ultimately, I would say, if bean:include is not working, but jsp:include is, go for it. Use what works and don't waste anymore time worrying about it.


-- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. http://www.edgetechservices.net/ 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED]




----- Original Message ----- From: "Raj Tilak" <[EMAIL PROTECTED]> To: <user@struts.apache.org> Sent: Wednesday, May 18, 2005 3:59 PM Subject: Re: bean:include doesn't work but jsp:include does[Scanned]


I did not get the response, would you please email me.

Thanks
Panchasheel

From: "James Mitchell" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: bean:include doesn't work but jsp:include does[Scanned]
Date: Wed, 18 May 2005 13:56:12 -0400

You sent the below to taglibs-user@jakarta.apache.org, which is not a Struts mailing list, it is for the Taglibs project under Jakarta. However, I see where you did send something similar to this list a few days ago.

Did you not get a response on it?



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]




----- Original Message ----- From: "Raj Tilak" <[EMAIL PROTECTED]> To: <Administrator> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, May 18, 2005 12:16 PM Subject: Re: bean:include doesn't work but jsp:include does[Scanned]


I did ask this question on struts user list, the to address says [EMAIL PROTECTED]

Could you please let me know, it looks like a configuration of the server or network,
even in jsp if I write a simple HttpConnection to a test page,
the connection.connect() method fails to connect after opening the connection with url.openConnection.


Thanks
Panchasheel

From: "James Mitchell" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Tag Libraries Users List" <taglibs-user@jakarta.apache.org>
CC: "Struts Users Mailing List" <user@struts.apache.org>
Subject: Re: bean:include doesn't work but jsp:include does
Date: Tue, 17 May 2005 23:27:19 -0400

First, you should ask on the proper list. That would be the Struts Users List (CC'd on this reply).

I'll help you over there.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]




----- Original Message ----- From: "Gandle, Panchasheel" <[EMAIL PROTECTED]>
To: <taglibs-user@jakarta.apache.org>
Sent: Tuesday, May 17, 2005 8:04 AM
Subject: bean:include doesn't work but jsp:include does



bean:include fails when deployed to production on proper domain, it works fine on local host.

bean:include is not able to connect to proper server/port, it gives
java.net.ConnectException: Tried all: '1' addresses, but could not
connect over HTTP to server: 'servername: port'

although the servername and port printed in exception are right.
This works fine with jsp:include.

Does anybody encountered this and resolved it.
Reply would be highly appreciable.

Thanks
Panchasheel


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to