As per Java 1.7u25 you should add the Codebase attribute to your manifest and I have done that.
But now I can't test it locally as the the attribute value does not match my local JNLP, generated by Netbeans, wich have no codebase value.
What value should the manifest have for its Codebase and/or what do I have as codebase in my jnlp for it to work locally?
There's a few ways to approach this:
Use multiple codebase attributes:
You can supply multiple values to the
Codebase
attributes, thus allowing you to add local addresses as well.e.g:
Codebase: myproductiondomain.com localhost 127.0.0.1
Use Wildcards:
You can also use a wildcard attribute in the
Codebase
attribute, which can have multiple forms:- e.g.
Codebase: 127.0.0.1
(beware, that doesn't allow you to uselocalhost
!!) - e.g. a much more lenient
Codebase: *
- e.g.
Build Changes:
But more likely, you should modify your build system to produce a test and a production version using different
Codebase
attributes to prevent abuse.
Everything you need is in Preventing RIAs from being Repurposed:
Pay extra attention to that fun tidbit in the table of accepted wildcard saying, for the 127.0.0.1
entry:
Does not Match [...]
http://localhost
I've added an answer on how to automatically add those missing attributes as part of Netbeans build process.
It's a method that works with JavaFX, but it could give you some ideas: https://stackoverflow.com/a/19014303/2382937
来源:https://stackoverflow.com/questions/18534312/codebase-attribute-in-manifest-mismatch-when-testing-local