• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Am I abusing HTML forms?

If I make an HTML form and its only purpose is to store a single value to be sent to the server is that a bad idea?

Ive made fallback session management for people who disable cookies. I think URL rewriting is the term for it. The server sends the client a token (jsessionid) as part of the URL, the client returns it to the server as a form parameter. I could have it be returned to the server as part of the request URL but storing it as a parameter just seemed cleaner and it wont interfere with any commands the client sends.

Its just the name "form" kinda suggests to me something to be filled in, login form and the like.

Any takes on this?
 
it just seems completely uncessary. why not just have a button and on the click event it sends the data to the backend?

i wouldn't say there is anything wrong with what you are doing though.
 
If I make an HTML form and its only purpose is to store a single value to be sent to the server is that a bad idea?

Ive made fallback session management for people who disable cookies. I think URL rewriting is the term for it. The server sends the client a token (jsessionid) as part of the URL, the client returns it to the server as a form parameter. I could have it be returned to the server as part of the request URL but storing it as a parameter just seemed cleaner and it wont interfere with any commands the client sends.

Its just the name "form" kinda suggests to me something to be filled in, login form and the like.

Any takes on this?

I don't think your solution is bad. Its relatively small, maybe 100 characters in length. In addition your solution works even if someone disables javascript.
 
I am a bonehead. Me manually fooling around with the jsessionid is why my URL rewriting solution didn't really work that well.

Having the jsessionid stuck to the end of the URL for both server -> client and client -> server is how its meant to be done. HttpServletRequest getSession() method picks up on any jsessionid stuck to the end of the request URL and returns the session for that jsessionid. I don't know how it does this but it does and its marvelous.

What I was doing before was sticking the jsessionid into the HTML form as a hidden parameter and then getting it from there on the server. I had a manually set up class for storing all the jessionids of people without cookies and it would track/deal with their sessions (but not very well) 😳 I can delete all that guff now lol.
 
Back
Top