Looking at some examples on the internet, I saw that there are applications where they make a separation of layers from when a request is made to when it is persisted in a DB? Is there a real definition of these terms? Since I have seen that each user gives a different approach, mainly if it is the same VO and DTO or if an EJB would be considered a BO?
JGarnica's questions
I am developing an example of a rest api using jax rs and reached the point of having to add support for CORS and be able to consume it from an app made in React, the other day I published the REST API in an online server and when I consume it in React locally it works, but if I try to consume it from a page like Stackblitz or resttesttest it doesn't work.
It is worth mentioning that I am using Wildfly 13 as a server, I have already reviewed many different filter examples but none work for me in stackblitz or resttesttest.
Test API using filter: my api
here is my filter
@Provider
public class CorsResponseFilter implements Filter {
/**
* Default constructor.
*/
public CorsResponseFilter() {
// TODO Auto-generated constructor stub
}
/**
* @see Filter#destroy()
*/
public void destroy() {
// TODO Auto-generated method stub
}
/**
* @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
*/
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) servletRequest;
System.out.println("CORSFilter HTTP Request: " + request.getMethod());
// Authorize (allow) all domains to consume the content
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "*");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Methods","GET, OPTIONS, HEAD, PUT, POST");
HttpServletResponse resp = (HttpServletResponse) servletResponse;
// For HTTP OPTIONS verb/method reply with ACCEPTED status code -- per CORS handshake
if (request.getMethod().equals("OPTIONS")) {
resp.setStatus(HttpServletResponse.SC_ACCEPTED);
return;
}
// pass the request along the filter chain
chain.doFilter(request, servletResponse);
}
/**
* @see Filter#init(FilterConfig)
*/
public void init(FilterConfig fConfig) throws ServletException {
// TODO Auto-generated method stub
}
}
The message I get in the browser console is this:
[Mixed-Content] The origin 'https://js-87ppru.stackblitz.io' was loaded in a secure context but tried to load an insecure resource at 'http://node42071-env-8457498.jl.serv.net.mx/api'.
Here is the stackblitz example I use https://stackblitz.com/edit/js-87ppru
Note: I'm not interested in using a proxy like heroku's.
I have this example
$('#datepicker').daterangepicker({
timePicker: true,
startDate: new Date(),
endDate: new Date(),
locale: {
format: 'MM/DD/YYYY HH:mm'
}
}, function(start, end, label) {
$("#range1").val(start.format('MM/DD/YYYY HH:mm:00')+" - "+end.format('MM/DD/YYYY HH:mm:00'));
});
How can I dynamically change the daterangepicker to a dynamic datepicker? I mean that when clicking on a button, disable the second calendar and work like a classic datepicker.
Hello guys, for a long time I wanted to enter the PHP world but I had never finished giving myself the pleasure, one of the questions I have is how to handle the include and require paths and if you have several folders to include the php files of others folders is complex.
Example if I have a configuration of my system similar to this.
The problem is moving between the routes because if I want to include the config.php file in the WorkerImp.php class I don't know how to do it because of the routes, PHP tells me that the file cannot be included.
I have read about creating a configuration file with the base routes but I come to the same conclusion to be able to access those constant routes I need to add config.php
On my page I am making a products section using bootstrap where in general I am going to put 4 products per row, the problem is that when the name of the text is bigger the div grows but the divs next to it remain the same, I would like that have the same size of divs per row even though the product name is larger.
HTML
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="estilo.cs.css">
</head>
<body>
<div class="container">
<row>
<div class="col-sm-6 col-md-3">
<div class="grid_1_4">
<div class="picture">
<img src="https://i.gyazo.com/4f1486b7c4384522db07c2d9090682f2.png" class="img-responsive center-block">
</div>
<h3>Samsung Galaxy S7 Edge </h3>
<div class="price_details">
<p><span class="money">2100 </span></p>
<p><button class="btn btn-default">Agregar al carrito</button></p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="grid_1_4">
<div class="picture">
<img src="https://i.gyazo.com/4f1486b7c4384522db07c2d9090682f2.png" class="img-responsive center-block">
</div>
<h3>Samsung Galaxy S7 Edge extra plus extra plus extra plus </h3>
<div class="price_details">
<p><span class="money">2100 </span></p>
<p><button class="btn btn-default">Agregar al carrito</button></p>
</div>
</div>
</div>
</row>
</div>
</body>
</html>
CSS
body{
margin-top: 20px;
}
.grid_1_4{
text-align: center;
border: 2px solid #EEE;
}
.picture{
height: 200px;
}
.picture img{
max-height: 100%;
max-width: 100%;
}