Reputation: 3 Apprentice
- Active Members
- Active Posts:
- 89 (0.05 per day)
- 19-August 09
- Profile Views:
- Last Active:
- Sep 21 2012 09:26 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 16 Aug 2012Thanks for the quick reply!
Hmm.. so there is no avoiding the repetitions huh. I wish there is a way for server side code to access the previously created dom elements like jquery does.
And.. about your first comment, I now have another question
When dealing with security stuff, is it common to do checks in two steps?
1. in UI, disable some elements to tell user that they're not supposed to be changing stuff.
2. in server side code, don't trust the information passed on to you from server side code, and always reauthenticate. (I said 're' because the first authentication is done when the UI is first served to the user.)
Posted 19 Jul 2012Oh wow. I feel so spoilt now haha. Thanks for the thorough explanation.
So from what I gather, there seems to be 2 solutions:
2. Use ajax to pass along information needed to reconstruct the new Monster, then .php (or .jsp in my case) will construct a new Monster object, and call .levelup() on it.
Sigh.. maybe I should have used a more relevant example.
So in a monster-less land, I have this java object which talks to a database. Let's call it client
1. Client(String dbName) --constructor
2. void submitnewcontent(string new stuff)
in the .jsp file, I have a Client object instantiated.
<% Client c = new Client("mydb"); %>
now everytime the button is clicked, I want to call c.submitnewcontent("hiii");
In this case, the only solution I could think of is to make an ajax call to handleNewContent.jsp, and pass along "mydb" and "hiii"
then handleNewContent.jsp would have to reconstruct Client again, before calling submitNewContent("hii");
This doesn't seem like a good solution since reconstructing Client might be expensive (connecting to db, and what not).
And from your explanation (which was clear), it's not possible for me to make a call on submitNewContent on the same Client instantiation ('c') for every button click.
So.. have people always been reconstructing java object when they want to mutate/do stuff with it upon button clicks?
Posted 18 Jul 2012No no, I appreciate the fact that you were trying to help . Just try to provide a more relevant answer next time.
But anyways, I decided to merge everything into one page. I guess I can afford to cram the information into one page, and use an expand/collapse trick to make all the information look organized. Thanks a lot for providing several alternatives, Atli!
After discussing it with my friend, a more generic statement of my problem is,
"the same one JSON object is needed in the two different html pages
I think another solution is to pass the parameters needed to generate that JSON through GET. Then do a second generate of the book in bookdisplayerfunctions.js.
Still not a good solution, and this made me pretty sure that this is a problem with my design.
Posted 10 Jul 2012Yeah, that's what I gathered from googling around too .
How did other people/big websites get around this problem? Or maybe the problem is that there should never be a need for a client-side language to access a POST variable?
And thanks for the clear explanation
- Member Title:
- D.I.C Head
- 20 years old
- December 23, 1993
- Logic puzzles, rubik's cube, tetris, badminton, and pgo.. uh. pgomarring?
- Full Name:
- triste voile
- Years Programming:
- Programming Languages:
- Java, C++, C#
- Website URL:
xenoslash hasn't added any friends yet.