Solved

package shows as folder, subfolder

Posted on 2013-10-22
5
288 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I have not got chance to try. I will try and let you know soon
0
 
LVL 7

Author Comment

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now