Ajushi Jones

Greenhorn
+ Follow
since Dec 11, 2007
Merit badge: grant badges
For More
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 Ajushi Jones

Hi! A few months back I've studied and created a simple Struts blog. It's been 2 months now. I work as a PHP programmer but I want to practice and improve my Java skills so that maybe I could land a job in the future. I'm looking for someone who can mentor me and maybe I could offer some help with his/her project. I'd also love to learn Spring and Hibernate as well. Anyway just drop a message if you're interested
Thanks in advance!


Ajushi
14 years ago
Hi, we could display errors in Struts by doing actionErrors.add(key, new Actionmessage("string")), addErrors(request, actionErrors); and then outputting it into a JSP page via

I'm wondering, how do I output success messages in Struts? How do you normally/conventionally do it?

Thanks in advance!
14 years ago
Yeeeehaawww! "?list=list" worked!! I wonder why do I need to set the forward that way?

Ok, I'll research about the post-redirect-get pattern pattern. Are there any more patterns that I should be aware of?

I appreciate your effort David in helping me. Thanks a lot man, I've also learned some things
14 years ago
An edit to the code above (I changed it anyway): should be:


I tried debugging it and it goes on a loop (weird!) at lines 83-86 above:



I'm really tempted to create a separate PostsListAction class but I want to see and learn most importantly if this problem can be solved and why is it this way. I still don't get it

About the creating a createPost.jsp (a page with from to create posts), how would you suggest I solve it? Should I add a new create() method that forwards to createPost.jsp and then the jsp's action is pointed at the add() method (http://mysite/post?add) ?
14 years ago

David Newton wrote:I'd think you'd want to redirect to home.do after you're done, but I could be wrong.

In any case, the "update" method forwards to /home.do, not to post?list, as far as I can tell.

If you're not using Tiles you should consider removing the extra stuff related to Tiles, and at the very least remove the 30-line comment when posting the config so there's less to look at.



Sorry about the comments and I appreciate the suggestions, thanks! :)

I actually want the method to be forwarded to the user's posts list which is on http://mysite/post?list but it's giving me the StackOverflowException. Sorry I'm a newb at this.

Also, is it a good idea to forward a link to a JSP or must all links be forwarded to the controller? I'm thinking about creating a link that points to createPost.jsp

Thanks again!
14 years ago
Hi David! Here's my code:



and here's my struts config:

14 years ago
Hi I'm using Struts 1.2.9 with Tomcat 6.0.18 and Netbeans 6.5 and it freezes every time I forward to the same controller path but with a different parameter.
I'm using EventDispatchAction.

I got an update() method and a list() method.

The update() method forwards to post?list ( which uses list() ). Everytime it forwards there it gets stuck up. I'm wondering why or is there a solution to this? Any help woudl be greatly appreciated! Thanks in advance!

Ajushi
14 years ago
I loved civilization as well!

Back in '98 when I was pretty new to the net, an aussie sent me a copy of Heroes II. I loved that game! I loved those days, happy memories
15 years ago
Ahh I get it now! Thanks a lot guys!
15 years ago
I'm getting it but not fully.
So you mean to say, at runtime I'm using ArrayList's add() method? What if I call a method that's not in the List interface, can I do that?

I get an ArrayList object with the type of List, is that correct?
15 years ago
I saw some code with this:



so when I do:



I'm calling the add() method of List and not from ArrayList right?
What are the advantages of using this?
Also, why do they do this if you can't use the specific methods of let's say ArrayList? I'm confused.

Thanks in advance!
[ January 01, 2009: Message edited by: Ajushi Jones ]
15 years ago
Any more suggestions or comments?
15 years ago

Originally posted by sudipto shekhar:
I hope you know UML is a modeling language which contains class diagrams,object diagrams etc.
For you to start with class diagram only would be sufficient. Practicing designing a project using UML diagrams helps easy visualization,modification to the project.

To start with, i would say applet is good. Go through the API documentation. Going through the API's is a good practice.

[ December 25, 2008: Message edited by: sudipto shekhar ]



Cool! Sorry man I don't know much about UML. How do I start planning/modeling with UML? Could you suggest some resources? Do you mean the whole Java API? Thanks again!

Anyway how about other project suggestions?
15 years ago

Originally posted by sudipto shekhar:
Merry Christmas.
To start with your first project I think you should proceed following a procedure.
To do a project even a small one first you should have the full view of what you are going to do.
I would suggest the UML would help. Tic-tac-toe or something like this would not require more that a class diagram. Class diagram will give you the full view of the classes and interfaces that you would need while coding. Any changes required in the implementation of a class or interface would be easily viewable making the changes easy and you will be able to design your project in totally OO manner.Once you are done with the diagrams the coding part becomes very easy.

Hope this helps.



Thanks sudipto! How do I do UMLs? Do I need a specific program or writing on a piece of paper would suffice?


I was thinking what libraries would I use? Do I create a Swing based GUI or maybe I could create an applet?
15 years ago
Merry Christmas everyone!

I think I'm ready to start with my first project! I'm thinking about crating a game. I was inspired the ones at http://www.java4k.com

I'm thinking maybe I could do a tic-tac-toe, a memory game or a more exciting one like a space invaders clone.

How do I start?
Do you guys know any tutorials that I could use? I'm kind of lost..

Thanks in advance and happy holidays!
15 years ago