I need help with this HTMLjavaCSS code httpswwwdropboxcomsrq

I need help with this HTML/java/CSS code.
https://www.dropbox.com/s/rql4a7fnotfkudr/IMG_20161031_123806.jpg?dl=0

https://www.dropbox.com/s/c7s329kg37h4i64/IMG_20161031_123839.jpg?dl=0

https://www.dropbox.com/s/p0i8cajpv8shqao/IMG_20161031_123908.jpg?dl=0

https://www.dropbox.com/s/wco5e4ww62erctx/IMG_20161031_123925.jpg?dl=0

Thanks for all the help.

Solution

I think for java you meant javaservlet page(jsp). Before implementing it you need to have tomcat server installed in your system. Download the tomcat server and google the instruction how to do initial setup and running it. If you are using windows then you can get the installation file from their site. Just install in default directory. it will most prabably in C:/tomcat/VERSION_NUMBER or C:/program files/ tomcat or C:program files[x86]/ tomcat. For mac, install it using brew.

$ brew install tomcat

all brew installation are in /usr/local/Cellar folder so go there

get inside tomcat folder and then its version folder. Now we will create the app and make it running.

You can use ide too. It\'s quite easy to do setup using IDE. If you have EclipseEE ide then its easy just follow this instruction

http://www.javatpoint.com/creating-jsp-in-eclipse-ide.

Now create a folder myapp in tomcat/version_number/libexec/webapps/myapp.

version_number could be 8 or 8.2.3 or 9. something. As per the J2EE specification, whatever web application you are create it must have sub-folder name WEB-INF and fille name of web.xml inside that subfolder.This file is called the web application assembly descriptor and contains custom instructions for the Tomcat server to work with the corresponding web application.

So we have myapp/WEB-INF/web.xml

edit this xml and put these lines

<?xml version=\"1.0\" encoding=\"UTF-8\"?>

<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"

xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"

xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\"

version=\"3.0\"

metadata-complete=\"true\">

<display-name>myapp</display-name>

<description>

It\'s my first application

</description>

</web-app>

It is necesary to have these lines to run the application except some of those lines.

Now we will write what we wanted. We will create three file inside the folder myapp i.e. index.jsp(main page), index.html(html page), style.css(stylesheet aka css)

index.html

<html>
<head>
<link rel=\"stylesheet\" href=\"style.css\">
</head>
<body>
<form action=\"index.jsp\">
<p>First Number: <input type=\"text\" name=\"num1\" size=\"10\"><br></p>
<p>Second Number: <input type=\"text\" name=\"num2\" size=\"10\"><br></p>
<br>
<p id=\"border\">
<input class=\"bru\" type=\"radio\" name=\"op\" value=\"add\"> <label for=\"html\"> Add </label> </input><br>   
<input type=\"radio\" name=\"op\" value=\"sub\"> <label for=\"html\"> Subtract </label> </input><br>   
<input type=\"radio\" name=\"op\" value=\"mul\"> <label for=\"html\"> Multiply </label> </input><br>   
<input type=\"radio\" name=\"op\" value=\"div\"> <label for=\"html\"> Divide </label> </input><br>
</p>

<input type=\"submit\" value=\"Submit\"><br/>
</form>
</body>
</html>

index.jsp

<html>
<body>
<%
double n1=Double.parseDouble(request.getParameter(\"num1\"));
double n2=Double.parseDouble(request.getParameter(\"num2\"));
String op=request.getParameter(\"op\");

if(op.equals(\"add\")){
double ans = n1 + n2;
out.print(String.format(\"Sum of %.2f and %.2f is %.2f\", n1, n2, ans));
}
else if(op.equals(\"sub\")){
double ans = n1 - n2;
out.print(String.format(\"Difference of %.2f and %.2f is %.2f\", n1, n2, ans));
}
else if(op.equals(\"mul\")){
double ans = n1 * n2;
out.print(String.format(\"Multiplication of %.2f and %.2f is %.2f\", n1, n2, ans));
}else if(op.equals(\"div\")){
double ans = n1 / n2;
out.print(String.format(\"Division of %.2f and %.2f is %.2f\", n1, n2, ans));
}
else{
out.print(\"Invalid choice\");
}

%>
</form>
</body>
</html>

style.css

p#border {
width: 20%;
height: 100px;
border: 1px solid black;
}

.bru{
padding: 0 10px;
text-align: left;
}

This is the solution of your first problem. You can do bit of styling as it suits you. Same way you can do others. You need input text box , radio button and submit button. All I have written in this problem. You can edit the html and check it by opening in the browser how does it look. Then use index.jsp page to manipulate it.

I need help with this HTML/java/CSS code. https://www.dropbox.com/s/rql4a7fnotfkudr/IMG_20161031_123806.jpg?dl=0 https://www.dropbox.com/s/c7s329kg37h4i64/IMG_2
I need help with this HTML/java/CSS code. https://www.dropbox.com/s/rql4a7fnotfkudr/IMG_20161031_123806.jpg?dl=0 https://www.dropbox.com/s/c7s329kg37h4i64/IMG_2
I need help with this HTML/java/CSS code. https://www.dropbox.com/s/rql4a7fnotfkudr/IMG_20161031_123806.jpg?dl=0 https://www.dropbox.com/s/c7s329kg37h4i64/IMG_2

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site