Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

package shows as folder, subfolder

Posted on 2013-10-22
5
Medium Priority
?
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 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 36

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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

688 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