Solved

package shows as folder, subfolder

Posted on 2013-10-22
5
295 Views
Last Modified: 2013-11-22
hi,

I am trying below example on my other machine.

http://www.srccodes.com/p/article/24/spring-3-mvc-framework-based-hello-world-web-application-example-using-maven-eclipse-ide-and-tomcat-server


when i created
'SpringMVCHelloController.java'
under package
 package com.srccodes.spring.controller;

For me, it is showing folder structure and then sub folder structure as attached where as in the link package structure for the author looks different without any folders. Am i doing anything wrong. I just created'SpringMVCHelloController.java'
 file in default package  then created the package and then moved it to
package com.srccodes.spring.controller;
please advise
Any links resources ideas highly appreciated. Thanks in advance
Str2.jpg
0
Comment
Question by:gudii9
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39592757
Look at your screenshot again.... you have your Java file in the package folders under "src/main/resources" whereas it should be under "src/main/java".

When you create a new class (via the "New Class Wizard") the very first input box asks you for the source folder location, make sure this specifies the location as above, ie. java folder not resources folder. Also, rather than creating it in the default package and then moving it, you can specify the package where you want your class created in the 2nd input box in the New Class wizard page.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39609763
what is the difference between 'Source folder' and 'package folder'. why we need both of them. Both seems same to me. please advise
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39610429
By "package" folders I was just referring to the folders "com", "srccodes", "spring", and "controller" that are in your screenshot, ie. the folder hierarchy that makes up your package structure. There really is NO difference between what I was calling "source" folders and "package" folders, they are both "source" folders because they contain "source" code. I just said package folders to be specific that the ones that I was referring to were specifically related to the package structure.

Anyway, all of that is irrelevant to your original question. Were you able to create the SpringMVCHelloController.java file in the correct place and get the same view as the author of the tutorial?
0
 
LVL 7

Author Comment

by:gudii9
ID: 39610665
I have not got chance to try. I will try and let you know soon
0
 
LVL 7

Author Comment

by:gudii9
ID: 39636171
I am still having issues in running this example. Will try on other machine and let you know
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
table example 4 32
varialbe initialization 11 37
Eclipse with gitlab 1 81
Unhandled exception type Exception 18 43
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question