Solved

package shows as folder, subfolder

Posted on 2013-10-22
5
294 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
replace a word with other 1 44
servlet example 17 32
Tomcat: Unable to run tomcat service. 2 20
going to wrong jsp page 2 21
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

810 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