Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HtmlUnit problem: Change the Request

 
sam backet
Greenhorn
Posts: 22
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a problem. I'm using a webApplication, which I run via a Jetty-Server
Now I want to send Requests, to test the responses.



But, I don't undersatnd it to change the session. A class of my application calls an attribut from the request. How is it possible to change the atrribut in my request.




Sam
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
request.getSession().setAttribute("newValue", newValue);
 
sam backet
Greenhorn
Posts: 22
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn' work, because I'm using the WebRequest from HMTL-Unit. and there is no "request.getSession"?

And if I use the WebRequest from class "HttpServletRequest" I don't know how to initialize the client. and send the message.

Do you know, how I can solve it?

michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic