Can Flash Builder 4 create a .war file? - apache-flex

I'm doing Flex development in Flash Builder 4 and I haven't been able to find a way to get it to create a .war file. The project creation wizard lets you select a web server to run your project in so I would expect it to be able to create a .war file. The default behavior is just to copy everything into the project name under Tomcat's webapps/ directory.
Has anyone been able to find a way to create a .war file with Flash Builder 4?

I have my project set to automatically publish to the GlassFish server so it doesn't normally create the .war file, but you can export the project to get it to create it.
It's under the File menu to Export and then you select the WAR file format.

Related

Just publish modified controllers, models and some parts of a ASP.NET MVC project

If I change my views (.cshtml) or styles (.css) or scripts (.js) in my MVC projects then I can publish it easily by right click on it and select Publish FILE_NAME
If I changed some controllers files or BLL classes or infrastructure classes,
Which files should be published? which DLLs?
Of course added references must be published but what are another?
Should I publish all the DLL files in the bin folder or just some?
Is there an easy way to VS detect modified files and publish theme by a command or...?
Edit1
I use FTP method to direct publish and upload our site to the server.
My Publish Preview Step Snapshot:
What is the name of DLL files that contains the compiled information of controllers, BLL classes and...?
I just published the MVC5Bootstrap-3-1-1-Less.dll and it worked!
So if we uploaded a website and then want only publish the new modified controllers or classes of the MVC web application (here: MVC5) to the server, we should upload the following files:
MVC5Bootstrap-3-1-1-Less.dll after build
Added references to the bin folder after build
Here is a image of how publish DLLs of bin folder from Visual Studio:
The publish wizard on the project (right click on project > Publish...) should automatically determine which files have changed and need to be updated, and show you what files will be updated.
After clicking Start Preview:

How to add project (.sln) into existing asp.net website files

I have tried almost all methods to make new project using exisiting files of asp.net in vs 2010 but i failed to run on new machine.
each time i did this it shows error that "could not load project from d:\path name" etc etc that is my last computer path name
Now what i am looking for , i have a website and all asp.net pages but i am unable to see its working by single click on project exe .
please help me out that how i can make project using existing asp.net files
remember : i have only asp.net pages to laod directly into visual studio but i want project exe so when i click on .sln file i can see site working.
In order for it to work you need to keep in mind you have to use original source code and not pre-compiled code from the server. To import your old files into a .sln file:
Create a New Website/Web Application
Add Existing Item Select item(s)
that you are trying to import into this new solution.
Make sure you dont add any .vbproj or .sln files from the previous project.

Eclipse Indigo and Maven : Unable to find src/main/java in dynamic web project

I've been using Eclipse indigo with m2e and m2e-wtp installed.
I created a dynamic web project using m2e by selecting maven-archetype-webapp. Now the problem is, I could not see src/main/java, src/test/java and src/test/resources in the created structure. Here is a snap of the project.
I stumble around and found this link. I created required directories on file system. Now the question is ideally where should I add "Source Folder" for each directories(src/main/java, src/test/java and src/test/resources)? Should I add them under "Java Resources" or somewhere else?
Thanks
That's exactly how we do it.
src/main/java, src/test/java and src/test/resources
under java resources -> new source folder
Don't forget to add your src/main/java path and the maven dependencies to the deployment assembly of your project if you want to run the web app from eclipse via tomcat.
EDIT
Concerning Eclipse Deployment:
If the project is already facetted as a Dynamic Web Project like yours, you'll need to add a Server in the Server view (We use Tomcat 7 and reference a local tomcat copy in the server setup)
Then you add the web projeect to the server (add/remove on the server)
In the project properties you'll need to add the src/main/resources and src/main/java folders to your deployment assembly as well as the maven dependencies.
We also use a src/main/webapp folder instead of the webcontent folder that is automatically created. This holds the web resources, WEB-INF and views and will be added to the deployment assembly as well and mapped to the root path '/'
Now you'll run an install on your app and then select 'run on server'
Just after the creation of a web application based on the archetype 'maven-archetype-webapp', it is perfectly possible to run the wep application in making usage of 'run as' on Tomcat (by example). You have right to a jsp page, index.jsp.
But if you want like many others create a servlet then you have a problem. The build path of the projects references 'src/main/java' and 'src/test/java' but the directories do net exist yet. I don't know why they forgot to create the directories (within the archetype)...
To correct the problem, you 'simply' have to create the missing directories (from the explorer) and then from Eclipse do a right-click on the project name and then click on 'Maven' and then 'Update Project'. If you create the directories this way you will see that the source directories (src/main/java and src/test/java will appear again).
Then create a new servlet (by example) in src/main/java and deploy the application again. Everyting will work this time.

Is there a better way to work with Flex Builder and the AMF Gateway?

I'm using Flex Builder 3 to connect to a bunch of back-end code via the AMF gateway. Another developer packaged up all the AMF Gateway code into a war file. Here's my development process:
Deploy most recent AMF-gateway.war file into local jboss server
War file gets unpacked into [jboss]/server/tmp/deploy/tmp23241AMF-gateway-exp.war/
Run Flex Builder. Point application project at AMF Gateway tmp folder in 3 places (Flex server root folder, Flex build output folder, Flex compiler 'additional arguments' (pointing to location of services-config.xml).
This setup means that whenever you start a debug session in Flex Builder, it dumps working versions of the files into the AMF-gateway folder on the jboss server (which is aliased as /AMF-gateway). The thing is, every time I restart jboss or deploy an updated AMF-gateway.war file, it gets unpacked into a new temp folder with a new name, and I need to change all the references in the Flex project. This happens several times a day, and it's annoying. Can I streamline this configuration? I tried using an alias to that folder -- figuring I could script the change -- but Flex Builder didn't seem to like it.
If I remember correctly, you can create a directory in JBoss that the server will treat as an exploded war file. I don't have a copy of JBoss handy to check, but I remember creating a directory such as "context-name.war" and being able to develop against that. So instead of copying your packaged .war file to the deploy directory, you could unzip it directly to that directory. If I remember correctly JBoss will monitor the web.xml file for changes and if it's overwritten it will redeploy the context.
Instead of using an XML approach: (i.e. SOAP/WSDL/REST), try using AMF to port to a different gateway such as C# to the database directly.
http://specialmoves.com/labs/code/flash-data-transfer-using-fluorinefx

Web Deployment Project builds files that are no longer part of the project

This is the error I get:
Error 101 Could not load type
'control'. /Test.vbproj/x.ascx 1 1
WebDeployProject
This is a left over file that was part of the project last week, but one of the developers deleted it from the project. I have to manually delete the file in order to get the WDP to build. Is there a way to tell the WDP to ignore the files that are not part of the project or to see that these files are not part of the project and delete them?
You'll need to use your source control tools to find and remove local files that aren't under source control.
For instance, if you're using TFS, do the following:
Open Source Control Explorer (View -> Other Windows -> Source Control Explorer)
Right-click on the path in TFS that corresponds to your local working copy and select Compare
Use your TFS path as Source Path and your local working copy as Target Path
Under View Options, select "Show items that exist only in target path"
You've now got a list of all the files that exist in your local working copy but aren't in source control. For each file, either delete your local copy or add it to source control.
It could have something do to with the type of web project is it.
If it's a web site, then the compiler will attempt to compile every file in the folder. However, if it's a Web Application Project, then it will only compile those that you've specifically added as part of the project.
If you have recently deleted/removed a file from your project then you need go to Project > "Show all files" and all removed files will apear in your solution explorer. You can delete the file, /x.ascx and rebuild your WDP.
It has nothing to do with the type of Web project: http://amiraryani.wordpress.com/2008/11/06/web-deployment-project-aspparse-could-not-load-type/.
A Web Site itself considers files under its root directory as part of the site.
A Web Application Project itself allows you to customize build actions, etc. on a per-file basis.
A Web Deployment Project, however, will try to include files under the root directory (a la a Web Site), even if the WDP is associated with a WAP. That's why it doesn't matter which kind of Web project it is.
EDIT: To clarify, it would matter what type of Web project you are using if you were trying to Build, Debug, or Publish that project itself instead of using a WDP.

Resources