Dmitri Christo

Ranch Hand
+ Follow
since Jan 19, 2007
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 Dmitri Christo

Go back to india.

You can create a better future for you and your family if you are in your home land. Given the current economic situation this would be best for all.
11 years ago
Thanks David,

I changed that textfield to:

Is my ognl syntax correct for the value parameter? The plan is to pre-populate the field with the id parameter taken from the URL, but keep it invisible to the user.

As you can see in my code in the above posts the Action class calls a save method which is delegated to the ServiceImpl class. Now during debugging, when the save method of the ServiceImpl class returns, the id is null (which causes a new insert) -- but when I query the person object at the Action class level, the id equals that new integer id defined automatically by the database.

I am not sure why the id is not retrieved from the URL successfully. It has to be grabbed there, or else a new record will be generated instead..
12 years ago
Yes, I'll do that thanks. But is there a way to use struts2 tags, within the existing <s:textfield> tag? Is there an example for that perhaps?
12 years ago
Yes, that field should be hidden actually, but, is there a way to retrieve that parameter from the URL at the jsp level? Using a struts 2 tag?

I am not sure if the following can help, but here are the related classes and struts.xml:


..And the action class:


..The Service implementation:


..And the two pages the user will navigate: list.jsp and edit.jsp :
,

and:


I certainly hope this additional information might help shed some more light this issue.

Thanks again for your response.
Regards.
12 years ago
Hello,

I am building a Struts2 application using Hibernate and after the user navigates through the pages, they follow a link:

Basically this brings up a form where the user will modify an existing record on a database. The record's primary key, (id) is provided as a parameter in the URL the user clicked on.

My problem is retrieving and storing this request parameter in the jsp page which contains the form. So far my form looks like this:

For a reason that I am not able to understand, the Primary Key field on the form, instead of being pre-populated, it is blank, waiting for the user to enter the value.

I know it must have something to do with how I use the struts tags, or the ognl expression, but so far, I was not able to solve this. The consequences is that instead of doing an update, the action ends up doing a new insert. The action code checks if the id is null and if it is then a new insert occurs, if the id is not null, then an update should take place:



So, how do I use a struts2 tag in a jsp to retrieve request parameters from the url? i believe that this is the root cause of my problem.

Thanks in advance for any help.
12 years ago
Thanks for the input. The case is that I have some education budget left and it has been recommended I use toward additional Sales training. Certainly it would be better if everyone in the team attended but...

Out of the 2 or 3 seminars you attended is there one you would say you got more out of? I know people attend these seminars for different reasons, but just wondering if you would share any specifics. Thanks
13 years ago
Not sure if this is the right place to post this, but, was wondering if anyone would suggest a Solution Selling training program / workshop in the US.

I am more interested in feedback from people who actually have attended such events before, and would recommend specific seminars delivered by specific organizations. Too many come up in a Google search and just would like some opinions first. Hope its ok to discuss this on JavaRanch.

Thank you
13 years ago
If there will be a new model, it will still come from the U.S. No other country has such a system to support business innovation, competitiveness and growth.
13 years ago
could be wrong, but seems like it was a family from India...
13 years ago
I am not sure what is wrong with my code. My question is, am I making one or two distinct requests/connections here? I can tell I am carrying the same cookie over to the second urlconnection, but I am still getting this response (when I retrieve and print the html response from the server):


Here is my approach:


--Am I making an obvious mistake I am not seeing, or could it be something with redirects, etc?

Thanks for any help
[ May 21, 2008: Message edited by: Dmitri Christo ]
Yes, HttpClient works smoother, but I have to user URLConnection in my case.

There is a lot of information about URLConnection and cookies out there, but couldn't find an answer to this one.

I am trying to understand the lifecycle of the session, so I can use the cookie in my response. So the connection is established with myUrl.openConnection(); - and it is opened with myUrl.connect(); right?

I have to set the cookie with myUrl.setRequestProperty("Cookie", myCookie); before calling connect(), but it is too soon because to find out the cookie value, I have to call getHeaderField(); after connect() -- Any ideas?
Hi, I am trying to understand how cookies should be handled over the same http session. I know how to query and store cookies and then send cookies back in a POST request but cannot do that in the same session.

Setting the cookie with setRequestProperty() must be done before calling connect(), but querying and storing the cookie with getHeaderField() is possible only after connect() is called. So, how can I send a cookie parameter before even knowing its value?

The trouble here is that with every connection the cookie value changes to reflect a new session id. If it was a cookie with a fixed/static value, I could do this in a two-step process. But this is not the case here..

Hope someone might have faced something similar..

Many thanks for any help.
[ May 20, 2008: Message edited by: Dmitri Christo ]
I can't tell for sure off the top of my head, I didn't keep count actually. Will take me some time to check that.

But, I did forget to mention in my previous post, that I had several inner classes mostly in the gui package (around 5 or 6 I think)

I wouldn't worry about the quantity of your packages, there is no right or wrong here. My main design principle was to keep everything minimal, almost basic, while fulfilling all requirements.

I'm sure you'll do fine
13 years ago
my choices.txt file was about 7KB (uncompressed). Sounds not too big, but you can put a lot of information in ascii format in there actually. My submission jar file was 365KB.

In the suncertify.code folder I had four packages:

db - 9 classes
direct - 1 class
remote - 6 classes
gui - 12 classes

Andrew's book gave me a lot of good ideas for the packaging structure and design in general. However, I didn't follow the value object approach (RMI works just fine with arrays of strings), and the use of concurrent package. I only used synchronized to take care of all locking.
13 years ago
Thanks Bob for your helpful advice so far, and best of luck with your assignment. I am sure you'll do just great.

Some more final notes:
1) I used RMI since it is straightforward to implement and there are plenty of good threads in this forum analyzing the topic.
2) I used minimal logging only during the remote connection phase, just as an indicator that the connection was successfully established.
3) My assignment required cookies, and I used System.currentTimeMillis(); to generate the cookie with notifyAll(); in the unlock method. The design was based in two different classes (FileManager and LockManager). This is discussed in a lot of detail in past conversations.
4) Used this to check my locking design
5) Minimal GUI, just two text case-sensitive fields, and only three buttons: search, book and unbook - (Well, I lost some points here, so perhaps they do expect a more elaborate user interface)

I know searching this forum requires some effort, but you will really find all you need in here. I found out later I didn't even need to ask several of my questions in the first place, since they were already answered.
13 years ago