Chris Boldon

Ranch Hand
+ Follow
since Aug 10, 2006
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 Chris Boldon

In general, GWT applications shouldn't be 'switching pages'. A GWT app should really be one page, though that page would have multiple views.
9 years ago
GWT
I'm creating an application with a view based upon the DockLayoutPanel.

I initialize a DockLayoutPanel and add SimplePanels to the north, south, west, and center docks so I can pass them to the Presenters.

The presenter then adds a custom widget to the to the SimplePanel. The custom widget contains a StackLayoutPanel (think left stackpanel navigation like gmail). The issue is the stack isn't displaying correctly, I'm only seeing the first stack in the panel.

If I add the custom widget directly to the DockLayoutPanel without first adding a SimplePanel, it works fine. But this would mess up my MVP coupling.

Any help is appreciated.
9 years ago
GWT

myyron latorilla wrote:Hi, im also receiving this message in glassfish whenever I create a JSONObject object.

Sample log:
Dispatch[/role] to method 'getUsers' returned an exception
java.lang.reflect.InvocationTargetException

Sample code:
public ActionForward getUsers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
response.setContentType("text/html;charset=utf-8");

JSONObject json = new JSONObject(); //HERE IS WHERE THE EXCEPTION IS OCCURRING
json.put("userName", "Juan dela Cruz");
json.put("userID", "12345");
json.put("role", "System Administrator");
json.put("active", "true");
response.getWriter().write((new StringBuilder("[")).append(json.toString()).append("]").toString());

return null;
}

Any idea why this exception is occurring?..Thanks in advance



Can you debug the call? It's really hard to tell what's going on with a basic Exception and no stack track. Where exactly is the exception being thrown, and what is the complete stack trace when the exception is thrown?
10 years ago
I wasn't aware that Struts tags could grab objects off the request attribute. I was always under the impression that it had to be set on the form.
11 years ago
My database has a table that includes date, which I use as a timestamp, giving me nanosecond precision. However, there is a place in my application where I want to group and select rows by Date only, disregarding time.

Perhaps my query is wrong, but this is what I'm calling:


I'm trying to get the number of records for each day.

Hibernate is throwing the following error:


Here is the full method in my DAO:


Any suggestions? Thank you for your time.

Vishal Pandya wrote:
But this all looks very ugly.
What's your purpose behind all this exercise? Provide us more detail.Somebody may suggest you some workaround to achieve the same thing.



I have List<Hit> and Hit contains a Date (DATETIME format). I am trying to create a graph displaying the number of hits per day. In order to do this, I need to group all of the hits for the same day together.

Normally I'd do this on the database side, but I don't have that luxury.
11 years ago

Vishal Pandya wrote:

Chris Boldon wrote:...it would be 3,1-30 and 2,2-2.


Do you want to calculate which date gets repeated how many times?
I am unclear about the question.



Sorry about the clarity. Yes, that is exactly what I want.
11 years ago
I have a List<> of items that each contain a DATE field.

For the life of me, I cannot figure out how to group them by date.

Say I have 3 objects in my list that have a date of 1-30 and 2 items that have a date of 2-2. I'd like to create a new List that has the DATE and number of obejects that had that date. Using my previous example, it would be 3,1-30 and 2,2-2.

Thanks in advance!
11 years ago
Thanks for the prompt reply.

I'll better explain exactly what I am trying to do, maybe I am not understanding interceptor implementation.

I am trying to redirect anything not recognized as an action (ANYTHING) to a certain action.

ie
say my context is http://localhost/myapp/
and I have an action http://localhost/myapp/main.action
if a user types http://localhost/myapp/asdf I want to be able to direct that to another action.

In struts1 I was doing this with a filter, but I saw an opportunity to leverage some of struts2 new features. Maybe the better bet is to extend the struts FilterDispatcher, run my own code in the doFilter method then punch out to super() ? I guess the interceptors are executed after the action is already decided?
11 years ago
Hi all,

I'm trying to get a custom interceptor to execture before the default stack, but am having little luck.

I tried to define a custom stack with my custom being the first interceptor in the stack and the defaultStack being the second interceptor in the stack. The defaultStack still executed first.

Any ideas?

My goal is to have an interceptor executed before the framework even checks to see if the action being requested even exists.
11 years ago
I guess I am looking for a way to implement custom validation that will be inspected at the same time as annotation and xml-validator validation.

the validate() method runs at a different priority from my experience.
11 years ago
ActionForms are coupled to your view.

DTO, or 'Data Transfer Objects' are a common object that is transfered between layers.

ie getting an object out of the database, you won't have an ActionForm, you'll have a different object. If you wanted to display that object on a JSP you would transfer the values to the ActionForm and render the page (well, I wouldn't, but I'm not going to make this complicated).

In the other direction, if you were going to save something to a database from a web form. You'd take the values off of the ActionForm, put them on a DTO and send it on its way to your service layer (well, again arguable if you have some sort of facade or other layer, but speaking basically).
11 years ago
This would tell me you are trying to access ..../demo.do?actionType=edit

That method doesn't exist in your action. Your action has a method called EditUser, which of course should be named editUser to follow proper naming conventions. I didn't see where you are making that request, maybe in your javascript file.
11 years ago
Greetings,

I have recently started using Struts 2 and am starting to port some of my old Struts applications over.

One of my application has some complex validation code that makes database calls to see if values are already present, etc.

Is there a way to utilitze the Struts 2 validation framework to do this? Or do I have to do the old school way and forward to different results in an if loop based on certain results?

Thanks in advance.
11 years ago
I am starting a new project, and am trying to decide on what framework to use. Most of my experience is with Struts implementations. However, I am reluctant to start a new project on an old technology. I was leaning towards struts 2, since it seems very familiar to me, and provides Dojo integration.

Could you please give me some feedback/opinions on these frameworks?

Thank you.