Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Joshua Elkino

Ranch Hand
+ Follow
since Jul 24, 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 Joshua Elkino

Sorry for the bump, but i'm still looking for a solution.. anyone?
I'm trying to query on an elementcollection set but the line with the query is throwing a null pointer exception.




This would be so easy if hibernate would let me do a manual query but querying the venue_atmosphereratings table that hibernate created was not allowed by createQuery or createSQLQuery.

Any feedback would be great!
I'm building a swing application that takes command line calls and executes them. I'm ultimately trying to create the ability to start applications on remote workstations and since there is no standard Windows command to do this i found that PsExec can do this for me. The question now become instead of requiring a user to install PsExec seperately, can i drop it into my project source and call it as needed so that when i distribute the application, there is no outside dependency.

PsExec examples

Thanks
9 years ago
I'm going crazy because i'm getting the following error and i can't figure out why.

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
at java.lang.StringBuilder.append(StringBuilder.java:203)
at com.autonomy.ps.gs.IDOLListener.doPost(IDOLListener.java:37)

my code is



Line 37 is the append line. What am i doing wrong? I tried to put a sysout before the append to see what characters are being sent to my servlet post, but there is nothing in the logs. This happens even after i restart tomcat and there is nothing hitting the servlet.

Thanks
10 years ago
Hi,

I'm in the middle of developing my first app while i learn dev for Android. I chose to do a simple game but i'm looking for some guidance.

I have a firm understanding on Activities and Views, but i'm unsure what the best approach is in placing my code.

I have created a custom view called BoardView that will generate the background, initialize my game pieces that are bitmaps, implement the drag and drop features, and so on. Currently my activity is only creating the view.
I have actually created the logic of the game in a basic console java app but i'm unsure of where to to put this logic.

Should i initialize all my global values in the Activity and pass them to the View? Should i make them static?
Does anyone have any suggestions and best practices?

Thanks!
10 years ago
Where can i perform this check? It doesn't look there are any useful methods i can override for Action like i could on a servlet doPost, doGet.. other than execute. I don't think it even reaches that point if i try to submit using get.

11 years ago
is there a way to set the struts action bean so that i works with the get method and not just the post?
11 years ago
Ok so better question. How can i tell the difference between a forward or redirect from the client side? I too find it odd, but maybe there is something that is overwritting that configuration file setting
11 years ago
well the the difference is in the URL and on the refresh... If i do a refresh on a page that got "redirected" from the struts config, it tries to post back to the servlet... thus giving me the impression the page got forwarded rather than redirected. Am i wrong?
11 years ago
They go to the same place, but the problem is that using the config method it only forwards even if i set the redirect=true.
11 years ago
using the above example... the newsletterok.jsp page.
11 years ago
Using the config file redirect, the user gets sent to the jsp yet the URL is pointing to the servlet. If i refresh i get a POST once again.
If i use the new ActionForward code, it works as intended. I see the new URL where i'm forwarding to as well as refreshing without posting data back to the server.
11 years ago
Thanks David. I was trying to separate some responsibility for development purposes, but i guess i could just plug everything in together.
11 years ago
I've added redirect=true in something like <forward name="success" path="/newsletterok.do" redirect="true"/>, yet the page does not redirect. When i use then this works as intended. Why is that?
11 years ago
if i do a return new ActionForward("/MyServlet", true); instead, i see the redirect, but i hit the exception page as well. It looks like its failing before it gets to MyServlet because my first piece of code in either the post or get is an output that i never see in the logs.
11 years ago