where .jsp files put in web project - file

I have an issue where to put view (.jsp) file in the web applications.little bit confuse it may be inside the WEB-INF folder or out side the WEB-INF folder.
Lot of spring projects view(.jsp) files are stored inside the WEB-INF folder by creating sub folders.
I saw lot of sample spring projects it includes .jsp files inside the WEB-INF folder.
So What is the best practice for my question
Amila

If your application is servlet centric then you may add .jsp file under WEB-INF and request them via RequestDispatcher. If it is not then put .jsp outside the WEB-INF.

Related

How can I share files (HTML templates) between App Engine modules?

I am using the Go runtime of Google App Engine and have two modules. I would like to share HTML templates between them but don't the best way.
My modules are organised as below:
src/github.com/myproject/moduleone/app.yaml
src/github.com/myproject/moduleone/templates/base.html
src/github.com/myproject/moduleone/templates/homeone.html
src/github.com/myproject/moduletwo/app.yaml
src/github.com/myproject/moduletwo/templates/base.html
src/github.com/myproject/moduletwo/templates/hometwo.html
In my situation base.html is the same for moduleone and moduletwo. How can I share it between both modules without having to duplicate the file as is done now?
I would like to put base.html in a directory called src/github.com/myproject/templates but I believe neither moduleone or moduletwo would be able to access the file as it's not in the same or child directory of the module app.yaml files. Is my only option to symlink the base.html file between each module's template directory?
GAE regards each module as a standalone application (each will run in its own GAE instance). No uploadable artifacts are shared at GAE level between the modules, each such artifact needs to be separately uploaded in each module using it.
While other approaches are technically possible (as other mentioned) symlinking the files is IMHO the simplest solution to avoid code duplication in your own repo.
You could copy the templates to each module as part of a build step and gitignore the copied files.

How do I deploy my GAE project for only a specific folder?

I wonder how do I deploy my Google App Engine project only for a specific folder?
e.g. If my project source folder is "src", and inside this src folder have many sub folders. Say, I have css, app, images, and js folders, but I want to deploy only css, app and images folders to the GAE, I want GAE to ignore js folder during the deployment, is there any way to do so with some setting in app.yaml file?
Thanks!
Joel
Have a look at skip_files
Skipping Files
Files in your application directory whose paths match a static_dir path or a static_files upload path are considered to be static files. All other files in the application directory are considered to be application program and data files.
The skip_files element specifies which files in the application
directory are not to be uploaded to App Engine. The value is either a
regular expression, or a list of regular expressions. Any filename
that matches any of the regular expression is omitted from the list of
files to upload when the application is uploaded.
You can now add a .gcloudignore file to the root of your project (https://cloud.google.com/sdk/gcloud/reference/topic/gcloudignore). The syntax is the same as .gitignore files.
For the OPs case, placing the following in the root folder (next to app.yaml) should do the trick:
# .gcloudignore
src/js/

Accessing Subdirectory in public_html using CakePhp 2.0

my question is very simple.
I have a /cms subdirectory on my /public_html directory.
when I try to do: mysite.com/cms cake tries to find cms controller instead of showing the index.php that /cms contains.
How can I make cake to search this folder in the public_html?
Thanks.
Is this a folder that belongs to your app or is it an external one? This problem is most likely because your public_html folder is your cake root folder (or at least you have the .htaccess for routing there)
You may want to have your cake app on a subfolder instead of having it on the root of youe webserver
If the content belongs to yout app, you can put The cms folder on the wwwroot folder of your application or follow this tip and move all from cms to Pages folder

How to change the file upload folder in apache tomcat?

Tomcat 6.29 creates a folder under temp folder in apache tomcat, and when I uploaded a file with the path req.getSession().getServletContext() + specified folder but when the application is redeployed another application folder is again created so the previously uploaded files stay at the older deployed application. I want to upload files under webapp folder/app_name but at that time I take the specified doesn't exist. I wonder if it is possible to upload and retrieve the files under the webapp/app_name.
Note: application is developed with spring+hibernate and deployed with maven.
Yes. Just use a relative path in your file handler code. Go up with ../../.. etc. Or you can make a direct server request against the old app from within your handler - servlet to servlet, for example.

Deploying a XAP file into ~/ClientBin using VSeWSS

I have a SharePoint (using VSeWSS 1.3) project that creates a WSP file which installs my custom content types. One of the type also installs a custom version of DispForm.aspx which is hosting a Silverlight control, located in the ~/ClientBin as a XAP file.
Is there a way in the ListDefinition.xml file to instruct VSeWSS to deploy my XAP file into ~/ClientBin as part of the WSP solution? I know how to deploy images to the TEMPLATES\images folder, but not to ~/ClientBin .
Philipp
To get the XAP file into the ClientBin directory you could try this. Let the solution deploy the XPA file to a folder within the TEMPLATE directory (12 Hive). With a FeatureRecevier that triggers on the FeatureInstalled event you could then copy the XAP file from its location in the sub folder of the TEMPLATE directory to the ClientBin folder.
The FeatureUnistalled event can be used to remove the XAP file from the ClientBin folder when the solution is retracted.
WSP can place the Files in following locations
Any Sub Folder inside 12 Hive
GAC
Bin directory of the Web Application.
Considering the above I recommand you to Change the Location where you keep the XAP file. You can think about placing it in the _Layouts. That is how I Did

Resources