Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Maintaining Session using HTTPClient on a Rails Application -


i have applet talks rails application. wish maintain user's session applet's communication recognized part of user's browsing session. use apache's httpclient send request rails application not recognize request part of users session.

this code use build request, pass in session_id variable , http_cookie variable applet parameters:

        httpclient client = new httpclient();         cookie httpcookie = new cookie("localhost", "http_cookie", http_cookie, "/", null, false);         cookie sessionid = new cookie("localhost", "session_id", session_id, "/", null, false);          httpstate initialstate = new httpstate();         initialstate.addcookie(httpcookie);         initialstate.addcookie(sessionid);         client.setstate(initialstate);          postmethod post = new postmethod("http://localhost:3001/vizs/add"); 

any suggestions great!

slothishtype

i solved following code:

string session_id_str = "6a7eec105k231g51bjd0655e638034f3";

cookie sessionid = new cookie("127.0.0.1:3001", "_chatter_session", session_id_str, "/", null, false);

httpstate initialstate = new httpstate();

initialstate.addcookie(sessionid);

client.setstate(initialstate);

the 2 problems were:

1) not putting port number in url.

2) specifying wrong session id. in example application called chatter session_id _chatter_session. add session id applet parameter.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -