Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Erik van Oosten
Lowell,

Yes, it matters a great deal. The class java.net.HttpURLConnection does 
not give you return codes, it just throws an exception. You need to use 
something like apache commons HttpClient.

Btw, if you can not massage Wicket into doing what you want, you can 
always add a self-written servlet (or a servlet from any other 
web-framework) in the same web-application.

Regards,
 Erik.


Lowell Kirsh wrote:
 I think they will be using a java.net.HttpURLConnection. Does it matter?
   

-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Lowell Kirsh
Really? What about the getResponseCode() method?

http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#getResponseCode()

But I'm sure if you are right about not being able to get it from that
class, my clients will use the jakarta (or other) client instead.

So the idea of using a POS (plain old servlet ;-) did cross my mind,
but I was hoping to make my web page serve both purposes so that I
could minimize the amount of coding I would have to do. Hopefully I
can actually use the AbortWithWebErrorCodeException to serve this
purpose.

On 5/9/07, Erik van Oosten [EMAIL PROTECTED] wrote:
 Lowell,

 Yes, it matters a great deal. The class java.net.HttpURLConnection does
 not give you return codes, it just throws an exception. You need to use
 something like apache commons HttpClient.

 Btw, if you can not massage Wicket into doing what you want, you can
 always add a self-written servlet (or a servlet from any other
 web-framework) in the same web-application.

 Regards,
  Erik.


 Lowell Kirsh wrote:
  I think they will be using a java.net.HttpURLConnection. Does it matter?
 

 --
 Erik van Oosten
 http://www.day-to-day-stuff.blogspot.com/


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Erik van Oosten
Yeah, weird it is. Perhaps that method only returns something when there 
was a result code representing a successful retrieval, so anything in 
the 200-299 range. I am positively very sure that non-2XX codes will 
trigger an IOException.

Regards,
 Erik.


Lowell Kirsh wrote:
 Really? What about the getResponseCode() method?

 http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#getResponseCode()

 But I'm sure if you are right about not being able to get it from that
 class, my clients will use the jakarta (or other) client instead.

 So the idea of using a POS (plain old servlet ;-) did cross my mind,
 but I was hoping to make my web page serve both purposes so that I
 could minimize the amount of coding I would have to do. Hopefully I
 can actually use the AbortWithWebErrorCodeException to serve this
 purpose.

   


-- 
Erik van Oosten
http://2007.rubyenrails.nl/
http://www.day-to-day-stuff.blogspot.com/


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Lowell Kirsh
Strange, it says in the javadoc that it can return 404, for example.
But it also says it'll throw an exception on a bad connection.
Confusing indeed.

On 5/10/07, Erik van Oosten [EMAIL PROTECTED] wrote:
 Yeah, weird it is. Perhaps that method only returns something when there
 was a result code representing a successful retrieval, so anything in
 the 200-299 range. I am positively very sure that non-2XX codes will
 trigger an IOException.

 Regards,
  Erik.


 Lowell Kirsh wrote:
  Really? What about the getResponseCode() method?
 
  http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#getResponseCode()
 
  But I'm sure if you are right about not being able to get it from that
  class, my clients will use the jakarta (or other) client instead.
 
  So the idea of using a POS (plain old servlet ;-) did cross my mind,
  but I was hoping to make my web page serve both purposes so that I
  could minimize the amount of coding I would have to do. Hopefully I
  can actually use the AbortWithWebErrorCodeException to serve this
  purpose.
 
 
 

 --
 Erik van Oosten
 http://2007.rubyenrails.nl/
 http://www.day-to-day-stuff.blogspot.com/


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Frank Bille

Perhaps take a look at:

http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/pages/InternalErrorPage.java?view=co

specially in the configureResponse section.

Frank


On 5/10/07, Lowell Kirsh [EMAIL PROTECTED] wrote:


Strange, it says in the javadoc that it can return 404, for example.
But it also says it'll throw an exception on a bad connection.
Confusing indeed.

On 5/10/07, Erik van Oosten [EMAIL PROTECTED] wrote:
 Yeah, weird it is. Perhaps that method only returns something when there
 was a result code representing a successful retrieval, so anything in
 the 200-299 range. I am positively very sure that non-2XX codes will
 trigger an IOException.

 Regards,
  Erik.


 Lowell Kirsh wrote:
  Really? What about the getResponseCode() method?
 
 
http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html#getResponseCode()
 
  But I'm sure if you are right about not being able to get it from that
  class, my clients will use the jakarta (or other) client instead.
 
  So the idea of using a POS (plain old servlet ;-) did cross my mind,
  but I was hoping to make my web page serve both purposes so that I
  could minimize the amount of coding I would have to do. Hopefully I
  can actually use the AbortWithWebErrorCodeException to serve this
  purpose.
 
 
 

 --
 Erik van Oosten
 http://2007.rubyenrails.nl/
 http://www.day-to-day-stuff.blogspot.com/



-
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-10 Thread Igor Vaynberg

https://issues.apache.org/jira/browse/WICKET-552

-igor


On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote:


One of the requirements of the site that I'm building is that oneof
the pages be exposed programatically so that other programs can 'call'
it. They would know whether they'd succeeded or not by inspecting the
http status code returned. Since this is just a regular page  of the
site, when the call is successful a web page is rendered and returned.
In this case it would be ignored. But when there is an error, I'd like
to relay that to clients.

One thing I've been trying to do (without any success) is to throw an
AbortWithWebErrorCodeException from my constructor with a non-200 code
and a message. Now supposing that it works, I'd like to know how a
client could extract the message from the response. Is it sent as a
header, the entire body, or part of the body?

And if there is another approach that would work in my case, I'd love
to hear about it.

Thanks,
Lowell

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-09 Thread Jeremy Thomerson

What are they going to use to call it?  wget?  perl?  etc

Jeremy Thomerson

On 5/9/07, Lowell Kirsh [EMAIL PROTECTED] wrote:


One of the requirements of the site that I'm building is that oneof
the pages be exposed programatically so that other programs can 'call'
it. They would know whether they'd succeeded or not by inspecting the
http status code returned. Since this is just a regular page  of the
site, when the call is successful a web page is rendered and returned.
In this case it would be ignored. But when there is an error, I'd like
to relay that to clients.

One thing I've been trying to do (without any success) is to throw an
AbortWithWebErrorCodeException from my constructor with a non-200 code
and a message. Now supposing that it works, I'd like to know how a
client could extract the message from the response. Is it sent as a
header, the entire body, or part of the body?

And if there is another approach that would work in my case, I'd love
to hear about it.

Thanks,
Lowell

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] programmatic access to a wicket site

2007-05-09 Thread Lowell Kirsh
I think they will be using a java.net.HttpURLConnection. Does it matter?

On 5/9/07, Jeremy Thomerson [EMAIL PROTECTED] wrote:
 What are they going to use to call it?  wget?  perl?  etc

 Jeremy Thomerson


 On 5/9/07, Lowell Kirsh  [EMAIL PROTECTED] wrote:
 
  One of the requirements of the site that I'm building is that oneof
  the pages be exposed programatically so that other programs can 'call'
  it. They would know whether they'd succeeded or not by inspecting the
  http status code returned. Since this is just a regular page  of the
  site, when the call is successful a web page is rendered and returned.
  In this case it would be ignored. But when there is an error, I'd like
  to relay that to clients.
 
  One thing I've been trying to do (without any success) is to throw an
  AbortWithWebErrorCodeException from my constructor with a non-200 code
  and a message. Now supposing that it works, I'd like to know how a
  client could extract the message from the response. Is it sent as a
  header, the entire body, or part of the body?
 
  And if there is another approach that would work in my case, I'd love
  to hear about it.
 
  Thanks,
  Lowell
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user