Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project v1.1 #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

project v1.1 #1

wants to merge 6 commits into from

Conversation

gKlocek
Copy link
Owner

@gKlocek gKlocek commented Jun 14, 2017

comment

Copy link

@Zixxy Zixxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dodaj .gradle do git ignore

@@ -0,0 +1 @@
test
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.idea add to gitignore

compile 'org.glassfish.jersey.core:jersey-server:2.7'
compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.7'
compile 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.7'
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enter

<head>
<meta charset="UTF-8">
<title>Simple Jersey</title>
<style>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other file for styles

<a href="#" class="button" onclick="myFunction(4)"></a>


<script>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for js other file also

@@ -0,0 +1,109 @@
<!--
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move file to hello/front

config.packages("dupa");
ServletHolder servlet = new ServletHolder(new ServletContainer(config));

Server server = new Server(2222);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2222 to read from program arguments, shoudl start with argument -port 2222 etc.

public static void main(String[] args) {
ResourceConfig config = new ResourceConfig();
config.packages("dupa");
ServletHolder servlet = new ServletHolder(new ServletContainer(config));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if config might be read from file

public class Resource {
@POST
@Path("post")
//@Consumes(MediaType.JSON)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

import javax.ws.rs.core.MediaType;


@Path("home")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe api???

}
}
/*
@POST
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it working

gradle/*
jav.iml
gradlew*
gradle-wrapper*
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enter

<title>Simple Jersey</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>q
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-formatting

</script>

</body>
</html>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enter

<a href="#" class="button" onclick="myFunction(4)"></a>

<p id="demo"></p>
<script src="script.js">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collapse to one tag <script .../>

if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
} else {
document.getElementById("demo").innerHTML = this.readyState + " "+ this.status;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation

context.addServlet(servlet, "/*");

try {
try {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what for 2 try blocks??? Make one with catch and finally

config.register(new CORSFilter());
ServletHolder servlet = new ServletHolder(new ServletContainer(config));

Server server = new Server(2222);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port to program parameters

public class JettyServer {
public static void main(String[] args) {
ResourceConfig config = new ResourceConfig();
config.packages("server");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move packages to constant


return "<h2>xD: " + json + "</h2>";
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enter



@Path("home")
public class Resource {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add typical ping method with pong response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants