This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!

Vishal Shaw

Ranch Hand
+ Follow
since Aug 09, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
16
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vishal Shaw

Hi,

Good to hear that you are thinking about the blueprint first rather that jumping into code

Like Campbell suggested first identify your entities and chalk out the database.
Then, you can easily chalk out your classes ,like say you have an entity User than you can have a class named User. Then you plan out the methods needed by your entity for working, say addUser(). checkLogin().

As for the coding, just one tip, don't mix up your view layer with your business logic layer, keep them separated by using MVC.

Cheers,
Vishal.
6 years ago
Well there are plenty of books . I am sure if you search online, you'll get a lot of names. You can also study online tutorials
Hi,

To begin with use code tags for your code.Without it most of the ranchers won't take the trouble of looking at your code.

As for the code (yes, I took the pain), there are certain problems
- Your POJO is not Serializable
- You did not save the POJO object in the session , neither did you saved the session
- Your file name is userinfo.java while Class name is Userinfo.
- Most importantly, it's not "hibernet" , it's Hibernate

Vishal
Hi,

I think this might help you

Vishal
6 years ago

Jayesh A Lalwani wrote:Wikipedia has a good description



I have already studied this page. But there's one problem, in real life scenario, we may do upto 'n' no. of undos and redos. But here , it supports only one. Also, with every object I will have to implement this stuff. So, I was thinking about serializing the states in a log for the same and rollback the states from there.

What do you say? Is it a good idea to save the states in a log and work accordingly?

Jayesh A Lalwani wrote:You can implement any design pattern using core Java. SInce, you can use core Java in Swing, you can use any design pattern in Swing.

So, you know what's the Memento Design pattern?



Yes, Jayesh I know about the Memento Design Pattern. It can be used to rollback a state . For e.g. redo/undo an operation.

But I am unsure about it's implementation, like shall I save all the object's state whenever any minute change occurs? How do I save the state, shall I save the object for the same or maintain a log for the changes?
Hi,

Any ideas on how to implement Memento Design Pattern in swing?

Sorry, if I posted in the wrong forum, but I did not find any appropriate forum
I think you declared a bean in your xml but forgot to create the appropriate class.

Check it out.

Vishal
6 years ago
Welcome to Ranch,

Always use code tags for your code. That makes it much easier to go through it. I don't think anyone would bear the pain of going through your code until you useCodeTags. So, do it first

Vishal
6 years ago

Hank straub wrote:need help writing a program called the perfect catering company totaly lost and is due by 5 pm today



First of all you describe what you want to do, then you tell us what problems you are facing. Merely asking for help, without describing your problem won't work ( neither here , nor in real life).
Also choose a proper subject. Subject like "help", "code", won't work
6 years ago
Hi,

Basically you have got a List<Products> , then you loop around this and take out individual Products and you are printing the final Object. By default, the object's toString() method is Overridden to print the hashcode only. If you are expecting to print out the data when you print the object, then you need to Override the toString() method for the Products class and put your logic for the output.


This should work for you.

Cheers.
Vishal
6 years ago

Stuart A. Burkett wrote:Try reading the ErrorStream and InputStream of the Process instance. You should see the program output or any error in those.



Thanks , it works now. But , can you tell me why we get the stream as a separate one . I thought that the child process can share the stream with the parent process, But this does not seems true in this case.

Also there's one more problem, when I apply the same thing to a swing/webapp as the parent process, then it seems the parent terminates the child process without waiting for it to complete. So, how to achieve this stuff in a swing/webapp? Do I need to pause the parent Thread explicitely?
7 years ago
Hi,

I was trying a sample program to run another java file from my java file using Runtime.exec(). Here's the code for the sample program




Can anyone tell me why this happens? Is there an alternative to achieving the task
7 years ago

zohaib khan wrote:Thanks guys for reply and support.

Vishal img tag did not give expected result as it show image on same page instead of pop up.

I got it working using frames.

- Thanks
Zohaib.



If you want it in pop up, then on click of a link you open a pop up (there's a whole lot of it using javascript : search for a custom pop up dialog in google)

Then in that pop up you white the img code. That's it
7 years ago
JSP
Have you tried.
7 years ago
JSP