Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Mark Elliott

Greenhorn
+ Follow
since Jan 15, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark Elliott

A warning about trying this. I think that it should work (haven't tryied it myself). However if you go and look at the settings for cookies in netscape (for example) it specifically has an option to 'only allow cookies that will be returned to the originating server'. This would suggest that it would be best not to rely on the changing domain method as many people might have this set (not actually sure what the default cookie setting is (corporate build here you see)).
Additionally the method that you mention with two cookies is the way that I have seen it most often done (m$ for example do this) i.e. pass cookies when you move in query string and then set cookie on new site.
[ January 16, 2002: Message edited by: Mark Elliott ]
18 years ago
It really depends on how long you want objects to hang about. If you really only want then for the length of the request then use request scope if they need to live for the length of the session then session.
Also from the sounds of what you are doing a bean might be a better way to store the information (although this doesn't affect the debate on scope). But then again you may have your own reasons for doing it as you have.
18 years ago
This is just a (hopefully educated) guess as I have no means of testing. I presume that your plugin is being started due to the mime type of your original page. When you include this in your second page your browser will see the mime type of the wrapping page "text/html" and will attempt to render the whole page itself, and not bother sending it to the plugin.
[ January 16, 2002: Message edited by: Mark Elliott ]
18 years ago
JSP
The reason that the lines come in a flow is that you are not applying the correct html formating i.e.<br> where you get a line break. But I think that the other posts made this clear. (You will be able to see this if you do a view source on any page on this forum as your post will now have <br> in it.
To apply the right typ of line formatting write a sting replace function for your display page. I'm not going to write out all the code for one here but basically you want to for something along these lines
String formattedText(String formatMe)
{
int replaceWhere
\\ find the postion of return char

replaceWhere=formatMe.indexOf("\n");
....
some type of looping code etc to check whole string and replace at replaceWhere with <br><
....
}
You can do this before you put it in the database if you wish (this will give you one hit but alter the actuall post info) or format in the jsp/servlet at display time.
Hope that helps and I have made myself clear
[ January 16, 2002: Message edited by: Mark Elliott ]
18 years ago
JSP
If you want to 'turn HTML' off as you put it then you will have to do a sting replace on the < and > characters and replace with < and > (either when you put then in the database or when you display then on on a web page again). To keep the return formating you will have to do a search and replace for all the return characters and replace then with <br> as stated previously.
New tha would happen (ignoring the spaces and ") replace < and > with "& l t ;" and "& g t;". This way the browser will not think it is looking at tags that it should hide.
[ January 15, 2002: Message edited by: Mark Elliott ]
18 years ago
JSP
The reason that your variable is being updated every time is that by using the ! notation you have declared it as an instance variable of your jsp page. The instance of this page will stay alive as it were, for the entire time that the server is up, the variable will be incremented by every access of this page (which will include reloads). Due to the fact that every request will access the same instance of the page.
I think I have mixed up some terms here but I hope you get my meaning
18 years ago
JSP