Using JSP Files outside of the Eclipse IDE - html

Hey everyone, I'm new to using the Eclipse IDE, JSP/Java, HTML, Tomcat.
I was making HTML files, using notepad, prior to getting Eclipse, and I've finished with making that part of the website. I've gotten the Eclipse IDE now, which I've been using to make JSPs for some dynamic html, and I've completed them as well now.
The problems I'm having now are:
I don't know how to extract the JSPs from the IDE, so I can put it in my folder with the HTML pages
Which would bring me into another problem, I want to put the JSPs in an <iframe>, 2 of them make use of <jsp:forward> tags, I'm unsure if all of the forwarding and form submitting will remain within the iframe, because as far as I know <jsp:forward> doesn't have a target attribute, if this is going to be a problem, could anyone point me in the right direction for how to go about this?
Finally, I've only been taught how to the Tomcat server within the IDE, after I've extracted the JSP files from the IDE, how do I run Tomcat independently?
Thanks very much, I really appreciate your time and effort :)

I don't know how to extract the JSPs from the IDE, so I can put it in my folder with the HTML pages
Select source file(s) in Eclipse or explorer, hit Ctrl+C, open target folder in explorer, hit Ctrl+V.
Which would bring me into another problem, I want to put the JSPs in an <iframe>, 2 of them make use of <jsp:forward> tags, I'm unsure if all of the forwarding and form submitting will remain within the iframe, because as far as I know <jsp:forward> doesn't have a target attribute, if this is going to be a problem, could anyone point me in the right direction for how to go about this?
It's unclear what you have and what you're struggling with, but all with all this doesn't smell good. It look much like that you're approaching things the wrong way. I'd suggest to start learning servlets. I'd also suggest to develop without <iframe> as long as all pages runs at the same webserver. If you need some kind of head/leftmenu/footer includes, then you should be using server-side includes. JSP offers you the <jsp:include> for this.
Finally, I've only been taught how to the Tomcat server within the IDE, after I've extracted the JSP files from the IDE, how do I run Tomcat independently?
Assuming that you've properly created a dynamic web project, just rightclick it, choose Export > WAR file. Then just drop the obtained WAR file in /webapps folder of Tomcat and start it.

Related

create a (local) HTML webpage which uses a .jar file

I'm very sorry for the possibly confusing title and also for the following expressions, as I'm a complete newbie into coding.
Background:
To make life a bit easier for our team at work, I would like to create a super simple HTML page which lists the most useful links to other tools in our company but is also able to send commands to a converter which exists as a .jar file (which requires different arguments - see attached pdf). Currently, we are running the specific command in the standard command prompt window in Windows to convert files into different formats.
Basic idea:
It would be so cool to have a very simple GUI (incl. some buttons + input masks). The attached PDF should explain it quite well IMO. I would then send around the package (containing the .html + .jar converter files) to my colleagues, so they can open them locally on their PC. If this works out fine, I would love to run this page in on a local intranet web-server, so everyone in our company is able to use the page (without having to store anything locally on their pc).
I know that it might be a bit too much to ask for, but it would be great if you can give me some kind of how-to. Or maybe someone has some nice hints where to start with. I know a bit of html stuff. The most hardest part to me is to execute the inputs with the .jar file.
I would be really happy if someone is able to help out as it has always been a tiny dream to have this "tooling page".
Link to the PDF:
https://wetransfer.com/downloads/ced5bc513b6c551202ba45e4aecbf1bb20220223131350/48f236a4f0989d7cc0c4f3359c70e60320220223131410/269175

Going from webpage to website

I have been coding html/css for some time now, and I've gotten to be proficient at coding single webpages, but I can't figure out how to code a website. Some questions I have are:
Do I need to buy a domain if I want to build a website (for practice)
Are their special things I need to know (such as special tags) that I wouldn't have learned from coding just a single page?
Should I learn how to use a grid if I am coding multiple pages?
You may want to first decide what kind of back end you want (the server side code that builds and delivers the pages) I strongly recommend rails, and a react.rb.
You do not need a domain name.
A great way to start is to use a service like cloud9 which is free, and will get you going in no time. Cloud9 will do a one button setup of a rails environment and get you going.
Another approach is to begin using react.rb and just expand your skill set from the front end towards the server. The react.rb tutorial creates a simple chat application and you can do this all with the tools your already have. Once you have mastered that you can set up a simple rails server and start adding server side persistance (saving data on the server.) This is the approach I recommend, but full discloure: I am one of the leads on the react.rb project so I am very biased.
Well, you can build simple to wonderful STATIC websites from HTML/CSS but if you are talking about some serious web development then you will need to learn a server side scripting language. Most of the websites these days are database driven serverside webpages. There are many serverside programming languages and tutorials for the same out there.
I suggest you start with PHP (for scripting language) and MySql (for database)
Again, the choice of language is totally upto you.
Then you would need to learn about setting up a server on your local computer. For this you will need to learn about (x)-AMP. This would be WAMP, XAMP, MAMP depending on what OS you are using.
If you are only needing to develop a simple CMS website, then there are alot of CMS framework which you can go for, which will not require much of coding.
It seems as if you are looking to connect multiple pages to the same website, so you can navigate between pages. And it seems that you want to practice with local files. If that is the case, you need to first create a local folder for your website and use the a tag in your html files. Inside the a tag, you will need to include an href with the url to your other page. A link to another html page that is saved in the same folder as your original will look like this:
New Page
You will want to use external CSS and JavaScript files to keep all of your pages in the same format.
http://www.w3schools.com/html/html_links.asp
http://www.w3schools.com/tags/tag_link.asp

XSLT from the web - Needing the right dev/test environment

Mostly for learning and testing-purposes, I need an environment/software where I can apply XSL Transformations on websites (html).
It needs to support Sessions and Cookies because of a login required to actually reach the pages I want to transform via XSL.
The manual method aka calling the page in the browser and download it and copy into Eclipse for example, is too slow. I need an automated system.. if possible one which can call multiple pages via a script.
I know that this could be realized with a lot of coding in Java, but I hoped for a simpler solution...
Any ideas?
Thanks in advance!
No clue why people have downed this question -_-', but I've found a sufficing solution:
Using "wget" for downloading the files and Saxon HE (NET) for actually applying the transformations. Those programs can be easily called from windows CMD :)

How best to make a web app with multiple pages?

I'm trying to make a multiplatform offline webapp using PhoneGap. I know my html and css, but I'm not altogether familiar with the full capabilities of JavaScript, and I've never made a webapp before, let alone tried to use phonegap to empower it.
Right now, I have the main index.html that phonegap sets up for you, but now I'm uncertain as to how to proceed. If I want a button to take the user to another page from the main page, should I make a second html file and literally link between them, or is this a lot more complex than that?
Also (get ready for a possibly epically stupid question from a total beginner):
Do web apps have to be online? I'm really not clear on whether they function like normal websites in which they need to be hosted on a server, or if they can be packaged up and downloaded just like normal native apps. Please help!
Thanks.
Oh, and btw, I'm working in Xcode with the phonegap addon thing....I'm trying to get it running on the iphone before I move on to android.
Although the other answer helped me at the time, I thought I would add a more complete answer now, five years later, to my own first StackOverflow question.
To start with, a "web app" is the same as a "website" in a technical sense, and yes, they have to be hosted on a server in order to be accessed through the browser...just like every website. The only distinction is that a web app is generally a more dynamic and complex sort of website, involving JavaScript and AJAX. It would be misleading to call a simple website like this one a "web app," whereas Facebook is definitely a web app. Basically all web apps are websites, but not all websites are quite exactly web apps.
However, it only has to be "online" if you want it to be accessible anywhere from a browser via http. If you're making a Cordova app like I was at the time, that's not relevant. If you only want to run an application locally, you can do so with a local server like Python's SimpleHTTPServer or the one webpack provides, or any other alternative, including a server you write yourself from scratch.
As for the primary question about having multiple pages, yes anchor elements like my link are the standard way of connecting pages. To link among your own pages, you would have multiple .html files, and you would create a link with an href like href="myOtherPage.html", where that file is contained in the same directory as the file for the page linking to it. Alternatively you could set up a single-page-app where JavaScript loads new page content without the use of anchor elements-- in that case multiple .html files are not needed. Frameworks like Angular and React are helpful for accomplishing that, but it's by no means necessary.
In a typical web app, most of the time you would just need to create a link as you would if you were creating a link on a website. Also, Web apps can be developed via a local environment (research Mamp/ or Wamp) depending on the dependencies in which your app require.

I want to transform xml into html and save the html. What is the easiest way?

I would like to use an xml file to create a html email. I can create an xsl file to convert it to html but I don't know how I can then save or copy the generated html. Obviously if I view the source of the xml file I just get the xml source, not the transformed html. What is the simplest or quickest way possible without me having to use Java or C# or anything like that? Is there a web service that can do it? I've googled but with no luck.
EDIT
If I have to do a bit of coding to do this then I could probably manage it in php, javascript, java, vbscript or possibly python. I'd be surprised if a tool to easily do what I want hasn't already been created and made available publicly though.
EDIT 2 - Solution found
I've discovered that clicking 'View generated source' in the Web Developer toolbar of Firefox shows me the html. This is all I need, I can then copy and paste this. I'd still be interested to hear if anyone has any better suggestions though...
What you probably need is an XSLT-Processor.
On most Linux machines xsltproc should be available at the commandline (or be easily installed with 'sudo apt-get install xsltproc').
On Windows msxsl should be the right commandline tool (I didn't test it).
You could create a WinForms app and drop a WebBrowser control on it, though I'm not sure if that will let you save the rendered page without any user interaction.