Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Struts web app project  RSS feed

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am very new to Java and I have been given this project to complete. I need help. Can some one please give suggestions about how I can start this and guidelines on installing the necessary software. So my project is I have to build a Struts as Web application such as form, using Spring framework, hibernate as database ORM framework and backend is MySQL database.

My background is development but I am rusty in it because I haven't used in a while. I am trying to go back to development and thus I am struggling with it. Please need help.
 
Sheriff
Posts: 23582
48
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vani, welcome to the Ranch!

If you're very new to Java, then I'd say that it's going to take you about a year to learn enough about those things so that you could get started with your project. I'd also say that it's unfair of your employer to give you such a project without providing you any support for learning the required technologies.

Or perhaps you're I'm misinterpreting your situation?
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

I understand what you are saying but I took this as an challenge. But I don't know where to begin. The web form is given to me as image and I have to code. Please help. I would appreciate any help provide to start and finish this project. Thanks for responding.
 
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide more details about what are your requirements.
 
Marshal
Posts: 59388
187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:. . . it's going to take you about a year to learn enough about those things so that you could get started with your project. I'd also say that it's unfair . . .

Agree with Paul. I think youi should go back to whoever gave you that project and discuss it with them. While you are starting with Java┬«, you may wish to look at our FAQ about the very beginnings of Java┬« programming.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lakshmanan

I was given this project as a test when I applied for a job as Application Developer. I have no experience in Java the employer knows but still gave this project to do as next steps. I want to do as a challenge infact I took a day off from my present job and working on it. I downloaded JDK8, Tomcat, Maven and Elicpse and connected each other. Now I am trying to create a form which was provided to me to create exact like that. I am using HTML to create the form attributes. I would like to know the configuration part of it. Is there any Registration Form in Java which I can be referred too.. Please let me know.

Campbell,

I agree with you. Since this is process of a job interview I don't have much to discuss with the employer.
 
Lakshman Arun
Ranch Hand
Posts: 52
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have a look at that https://www.javatpoint.com/steps-to-create-struts-2-application-example for how to create a form for the client side and capture the values in Struts and show the result back to end user. For Spring and hibernate similar tutorials you can search for.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lakshamanan,

Thanks for the link. That helps. I can do with that tutorial. Also I am using IDE Eclipse is there a way to do GUI interface with drag and drop kind of tools. Any suggestion.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do my project from the tutorial in JavaTPoint. . As per the example below, I downloaded MyClipse 2017 latest version and started to save my project name. Next, second step, I don't have the Struts Capabilities in the MyClipse or I don't see it. Can someone please help asap. I am stuck.

2) Add struts 2 capabilities
To add struts 2 capabilities, select you project - click on the myeclipse menu - add project capabilities - add struts capabilities.

Select the 2.1 and /* as the url pattern - finish.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi can someone help please? I have marked red the error messages in the code. Can someone clarify why I am getting this error. Also where will I find Classpath and Project files?

package com.josephine.struts;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import com.actionRegistrationaction;


public class admin {
public static Connection conn() throws Exception {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "");
}
}

public static int register(Registrationaction jjform) {
int flag = 0;
try {
PreparedStatement ps = conn().prepareStatement("INSERT INTO jjform VALUES(?,?,?,?)");
ps.setInt(1, jjform.getId());
ps.setString(2, jjform.getfName());
ps.setString(2, jjform.getlName());
ps.setString(2, jjform.getcName());
ps.setString(2, jjform.getaddno());
ps.setString(2, jjform.getdir());
ps.setString(2, jjform.getstreet());
ps.setString(2, jjform.getype());
ps.setString(2, jjform.getaptno());
ps.setString(2, jjform.getcity());
ps.setString(2, jjform.getzip());
ps.setString(2, jjform.getstreet());
ps.setString(3, jjform.gethphone());
ps.setString(4, jjform.getwphone());
ps.setString(2, jjform.getcphone());
ps.setString(2, jjform.getemail());
ps.setString(2, jjform.getimmanual());
ps.setString(2, jjform.getresidence());
ps.setString(2, jjform.getresidence1());
ps.setString(2, jjform.getrecruitment());
ps.setString(2, jjform.getrecruitment1());
ps.setString(2, jjform.getads());
ps.setString(2, jjform.getpinetree());
ps.setString(2, jjform.gethomecare());
ps.setString(2, jjform.getnone1());
ps.setString(2, jjform.getmonth1());
ps.setString(2, jjform.getday1());
ps.setString(2, jjform.getyear1());
ps.setString(2, jjform.getmale());
ps.setString(2, jjform.getfemale());
ps.setString(2, jjform.getcob());
ps.setString(2, jjform.getcob1());
ps.setString(2, jjform.getresidence1());
ps.setString(2, jjform.getability());
ps.setString(2, jjform.getability1());
ps.setString(2, jjform.getpreference());
ps.setString(2, jjform.getcomment());
flag = ps.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
return flag;
}
}

 
Paul Clapham
Sheriff
Posts: 23582
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vani Jay wrote:import com.actionRegistrationaction;

public static int register(Registrationaction jjform)



If you wanted to import a type named Registrationaction, then you might try changing what you have to import com.action.Registrationaction; instead. (Notice the dot I inserted.) I don't recognize that type but maybe your compiler will, once you get the import correct.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Vani Jay wrote:import com.actionRegistrationaction;

public static int register(Registrationaction jjform)



If you wanted to import a type named Registrationaction, then you might try changing what you have to import com.action.Registrationaction; instead. (Notice the dot I inserted.) I don't recognize that type but maybe your compiler will, once you get the import correct.



I did but I am referring to a file and not importing. but the code I am working from example says like this. So I don't understand where the Import is coming from? Any thoughts?
 
Paul Clapham
Sheriff
Posts: 23582
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vani Jay wrote:I am referring to a file and not importing.



I don't understand what that means. You use an import statement in Java to tell the compiler that the classpath contains a type (class, interface, enum etc) with that name. If the classpath doesn't, then you get an error message. I don't understand what you mean when you say you're "referring to a file".

but the code I am working from example says like this. So I don't understand where the Import is coming from? Any thoughts?



The import should refer to a Java type which is in your classpath. What you're importing there isn't part of the standard Java API so you'd have to get it from somewhere else. Perhaps there's a jar file somewhere which you were supposed to download?
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the link below to the website I am looking for reference.

http://www.websparrow.org/struts/struts2-and-mysql-database-connectivity-example

According the reference, I created a web project using the Dynamic Web project in Eclipse.
Next under src, created com.josephine.struts. and underneath that, I created admin.java and Registrationaction.java
I imported the jar files to the lib under web content.
I created the web.xml file with code as specified in the reference.
Under web content, I created files such as error, success and register jsp files.
Finally created the struts.xml.

I am getting error in two pages - one is admin.java and Registrationaction.java.

Any idea why? and what could the reason. Also, cant get classpath and project. Where do I find them?
 
Saloon Keeper
Posts: 1984
265
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vani Jay wrote:... Next under src, created com.josephine.struts ...

The tutorial shows Admin and RegisterAction in a package named com.admin, not com.josephine.struts.

Vani Jay wrote:... underneath that, I created admin.java and Registrationaction.java ...

admin and Registrationaction or Admin and RegisterAction? Case matters.
 
Vani Jay
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Vani Jay wrote:... Next under src, created com.josephine.struts ...

The tutorial shows Admin and RegisterAction in a package named com.admin, not com.josephine.struts.

instead of com.admin, I created com.josephine.struts. Will that cause a problem? So should I bring com.josephine.struts to admin.java page?

Vani Jay wrote:... underneath that, I created admin.java and Registrationaction.java ...

admin and Registrationaction or Admin and RegisterAction? Case matters.

 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!