* Create and verify a private key

$ openssl genrsa -aes256 -out private_key.pem 2048

$ openssl rsa -noout -text - in private_key.pem


* Create a CSR

$ openssl req -new -key private_key.pem -out test.csr


* Create and verify a self-signed certificate

$ openssl x509 -in test.csr -out test.crt -req -signkey private_key.pem -days 3560

$ openssl x509 -noout -text -in test.crt


저작자 표시
신고

'Development > Common' 카테고리의 다른 글

Using the OpenSSL toolkit  (0) 2017.09.17
Date and Time Formats  (0) 2016.06.28
development - 개행문자  (0) 2016.03.02
매개변수(parameter)와 전달인자(argument)  (0) 2015.09.20
software release life cycle  (0) 2015.08.03
programming - read–eval–print loop (REPL)  (0) 2015.07.24
Posted by linuxism


It means that the receiving server does not recognise the mailbox (the part before the '@') of the e-mail address. It could be that it was misspelled, that it is simply a non-existing name, or it could even be that the receiving server was set to reject a message (e.g. spam) by replying with code 550.

Here is one of many pages that summarises the SMTP reply codes, and gives links to various relevant RFCs: http://www.greenend.org.uk/rjk/tech/smtpreplies.html.

EDIT: I need a bit more space to answer your question than the comments allow.

@RaghuKing, if you look at the Javadoc for javax.mail.SendFailedException, you will notice that you can call 3 methods on such an exception object (inside the catch block):

  • getInvalidAddresses() to get an array of addresses that are invalid and thus not sent to,
  • getValidSentAddresses() to get an array of addresses to which this message was sent succesfully, and
  • getValidUnsentAddresses() to get an array of addresses that are valid but to which the message was not sent to.

(Obviously, if one sends a message to multiple recipients, some may succeed and some fail, but the exception is thrown if there is at least one failure, regardless of how many successes. Obviously also if you are sending to only one address, you will have that one address in only one of these arrays, and it will probably NOT be in the ValidSent list.

These arrays will give you more information how to handle the exception, depending of the type of array an address is in. This will obviously depend on you application, but these might be reasonable suggestions:

  • Invalid Addresses: tell the user that the message was not sent because the address was wrong, for each invalid address in the list, and provide a way to correct the address, then try to resend to the correct address (or cancel if the user does not provide a different address);
  • Valid Sent Addresses: Don't resend;
  • Valid Unsent Addresses: Try to resend to these addresses. Sending probably stopped before getting to these addresses because of a previous incorrect address.

But in the end it is you who has to apply common sense, and perhaps experiment a little with the functions you don't understand until you understand them.



source - http://stackoverflow.com/questions/15131868/how-resolve-address-invalid-exception





저작자 표시
신고

'Development > Java' 카테고리의 다른 글

javamail - SendFailedException  (0) 2017.04.06
javamail - SMTP BCC  (0) 2017.03.31
java - NIO Selector and epoll  (0) 2017.03.17
java - Architecture of a Highly Scalable NIO-Based Server  (0) 2017.03.17
java - Understanding JUnit's Runner architecture  (0) 2016.07.24
java8 - Metaspace  (0) 2016.02.27
Posted by linuxism


How to use session in jsp pages to get information?


JSP implicit objects likes sessionrequest etc. are not available inside JSP declaration <%! %> tags.

You could use it directly in your expression as

<td>Username: </td>
<td><input type="text" value="<%= session.getAttribute("username") %>" /></td>

On other note, using scriptlets in JSP has been long deprecated. Use of EL (expression language) and JSTL tags is highly recommended. For example, here you could use EL as

<td>Username: </td>
<td><input type="text" value="${username}" /></td>

The best part is that scope resolution is done automatically. So, here username could come from page, or request, or session, or application scopes in that order. If for a particular instance you need to override this because of a name collision you can explicitly specify the scope as

<td><input type="text" value="${requestScope.username}" /></td> or,
<td><input type="text" value="${sessionScope.username}" /></td> or,
<td><input type="text" value="${applicationScope.username}" /></td>



source - http://stackoverflow.com/questions/17419727/how-to-use-session-in-jsp-pages-to-get-information

저작자 표시
신고

'Development > JSP & Servlet' 카테고리의 다른 글

jsp - SessionScope  (0) 2017.04.04
jsp - difference between eq and ==  (0) 2017.02.03
jsp - 컴파일(compile)  (0) 2016.05.13
jsp - jstl fn:contains  (0) 2014.07.10
servlet - 3.0 비동기 기능  (0) 2013.07.27
servlet - 필터(filter)  (0) 2013.07.27
Posted by linuxism